Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CircleClock]how can I make the minute hand and the hour hand shoter? #314

Open
89ao opened this issue Feb 22, 2024 · 0 comments
Open

[CircleClock]how can I make the minute hand and the hour hand shoter? #314

89ao opened this issue Feb 22, 2024 · 0 comments

Comments

@89ao
Copy link

89ao commented Feb 22, 2024

I've recently make the CircleClock hand-like instead of circle like(https://github.com/89ao/.hammerspoon/blob/a388afe9c89667c073319bd3ad1ae35847e88b84/Spoons/CircleClock.spoon/init.lua)
image

Howerver, when I use percentage number in coordinates key to location the minute hand and hour hand ,It seem to consider the full frame, which makes the minute hand and the hour hand seems to be too long .

    obj.canvas[3].endAngle = secangle
    local minangle1 = 6 * math.tointeger(os.date("%M")) + 6 / 60 * math.tointeger(os.date("%S"))
    local minarc_x = 50 + 50 * math.sin(math.rad(minangle1))
    local minarc_y = 50 - 50 * math.cos(math.rad(minangle1))

    obj.canvas[7].coordinates = {
        {x = "50%", y = "50%"},
        {x = tostring(minarc_x) .. "%", y = tostring(minarc_y) .. "%"}
    }

So the question is : How can I make it shorter (for example hour hand inside the watch_hourcircle/canvas[4] and minute hand inside the watch_mincircle/canvas[6] )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant