Skip to content

Commit

Permalink
refactor per jkrumbiegel's review
Browse files Browse the repository at this point in the history
  • Loading branch information
bjarthur committed Nov 24, 2024
1 parent 3e61d11 commit 1c97dc9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/makielayout/blocks/toggle.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ function initialize_block!(t::Toggle)

onany(topscene, t.orientation, t.length, t.markersize) do or, len, ms
theta = or == :horizontal ? 0 : or == :vertical ? pi/2 : or
t.width[] = (len - ms) * cos(theta) + ms
t.height[] = (len - ms) * sin(theta) + ms
autowidth = (len - ms) * cos(theta) + ms
autoheight = (len - ms) * sin(theta) + ms
t.layoutobservables.autosize[] = (autowidth, autoheight)

Check warning on line 9 in src/makielayout/blocks/toggle.jl

View check run for this annotation

Codecov / codecov/patch

src/makielayout/blocks/toggle.jl#L5-L9

Added lines #L5 - L9 were not covered by tests
end

button_endpoint_inactive = lift(topscene, t.markersize, t.layoutobservables.computedbbox) do ms, bbox

Check warning on line 12 in src/makielayout/blocks/toggle.jl

View check run for this annotation

Codecov / codecov/patch

src/makielayout/blocks/toggle.jl#L12

Added line #L12 was not covered by tests
Expand Down

0 comments on commit 1c97dc9

Please sign in to comment.