-
Notifications
You must be signed in to change notification settings - Fork 118
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
xilem_web: Add Rotate
and Scale
(CSS) transform views
#621
xilem_web: Add Rotate
and Scale
(CSS) transform views
#621
Conversation
48016b8
to
6133a95
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Just some random thoughts:
Maybe in the future we can add types that handle different units like degrees, etc, but that's probably not where we're at here (users can use an external crate for proper unit handling). Or we could add a Radians
type so that the user at least knows what is being used here, although this might be an unnecessary thing that just makes things cumbersome.
…y the CSS `transform` value.
6133a95
to
8030c7b
Compare
I think default radians and an additional Anyway, I've removed the macro Thanks for the review, AFAICS there weren't objections in office hours, so I guess we can start experimenting with this kind of modifier API in xilem_web (with a potential future in xilem itself), so I'll merge this. |
…t`s (#765) As noted in #621 (comment), rustwasm/wasm-bindgen#4143 is now added in wasm_bindgen 0.2.96. This PR updates all the dependencies of xilem_web and finally correctly supports `style` for `MathMlElement`.
This sketches/implements (parts of) the transform modifier API described in Add
Affine
transform toWidget
trait? for xilem_web.This currently includes
rotate
andscale
, because there are less cases to handle for these CSS transform functions.In
rotate
I think we can reduce this to just radians (there are more units for<angle>
:turn
,grad
,deg
andrad
(used here) but they can all be derived from radians), and percent in scale is kinda redundant (as200%
==2.0
)), for exampletranslate
has more cases as it includes all kinds of units (likepx
,em
,%
etc.), so this may require more thought (and is thus probably better for a future PR).This can be combined with untyped
transform: ...
as style, these modifier views extend thetransform
style (while the untypedstyle(..)
overwrites previous set values).The
svgtoy
example is updated to include these views.