Skip to content

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

@89ao

Description

@89ao

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions