Hammerspoon / Hammerspoon/Spoons

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

Open
#314 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Lua
Stars
567
Forks
171
PR merge metrics
No merged PRs in 30d

Description

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] )

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.