-
Notifications
You must be signed in to change notification settings - Fork 123
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This sketches/implements (parts of) the transform modifier API described in [Add `Affine` transform to `Widget` trait?](https://xi.zulipchat.com/#narrow/stream/317477-masonry/topic/Add.20.60Affine.60.20transform.20to.20.60Widget.60.20trait.3F/near/472076600) for xilem_web. This currently includes `rotate` and `scale`, because there are less cases to handle for these [CSS transform functions](https://developer.mozilla.org/en-US/docs/Web/CSS/transform-function). In `rotate` I think we can reduce this to just radians (there are more units for `<angle>`: `turn`, `grad`, `deg` and `rad` (used here) but they can all be derived from radians), and percent in scale is kinda redundant (as `200%` == `2.0`)), for example `translate` has more cases as it includes all kinds of units (like `px`, `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 the `transform` style (while the untyped `style(..)` overwrites previous set values). The `svgtoy` example is updated to include these views.
- Loading branch information
Showing
4 changed files
with
373 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.