-
-
Notifications
You must be signed in to change notification settings - Fork 317
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
add kwarg to rotate Toggle #4471
Conversation
1b5999b
to
fde35a9
Compare
7039342
to
9ef4860
Compare
d29d9ad
to
c2394c9
Compare
i've fixed the alignment issue in the previous comment by refactoring to do my own rotation instead of using @ffreyer 's method. i couldn't figure out another way to do it. everything seems to work, and i suspect tests will pass, but only because none of the reference images uses the there is a slight backwards incompatibility that might warrant a bump in Makie's minor version with this PR as the size of the toggle is now controlled by |
i'm confused about the CI failure for ref img "Button - Slider - Toggle - Textbox":
it works fine locally and nothing in this PR should effect that test. |
bb29eb4
to
a808d7a
Compare
could you please review again? |
Tests fail because I merged the new refimg with an existing one. So no problem there. I'm not sure about the (width, height) -> (length, markersize) change. I see why it's there but I wonder if width, height is supposed to be something users can always set. Right now it gets overwritten if I'm not mistaken. |
The boundingbox computation does not work correctly for all rotations yet which you can check like this: f = Figure()
rot = Observable(0.0)
Box(f[1, 1], color = :tomato)
Toggle(f[1, 1], orientation = rot)
sl = Slider(f[1, 2], range = 0:0.01:2pi)
connect!(rot, sl.value)
f |
oof. good catch. fixed in latest commit. i've added a ref image to test for this too. |
Description
fixes #4378; supersedes #4445.
adds
orientation
kwarg toToggle
that specifies the angle in radians to rotate the toggle. default of 0 is horizontal with active being to the right.Type of change
Checklist