Skip to content

Commit

Permalink
xilem_web: Add style size hints to Rotate and Scale modifier
Browse files Browse the repository at this point in the history
  • Loading branch information
Philipp-M committed Oct 10, 2024
1 parent 617aae4 commit 8030c7b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions xilem_web/src/style.rs
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,7 @@ where
type ViewState = (E::ViewState, Option<CowStr>);

fn build(&self, ctx: &mut ViewCtx) -> (Self::Element, Self::ViewState) {
ctx.add_modifier_size_hint::<Styles>(1);
let (mut element, state) = self.el.build(ctx);
let css_repr = modify_rotate_transform(element.get_style("transform"), self.radians);
element.set_style(&"transform".into(), &css_repr);
Expand Down Expand Up @@ -647,6 +648,7 @@ where
type ViewState = (E::ViewState, Option<CowStr>);

fn build(&self, ctx: &mut ViewCtx) -> (Self::Element, Self::ViewState) {
ctx.add_modifier_size_hint::<Styles>(1);
let (mut element, state) = self.el.build(ctx);
let css_repr = modify_scale_transform(element.get_style("transform"), self.scale);
element.set_style(&"transform".into(), &css_repr);
Expand Down

0 comments on commit 8030c7b

Please sign in to comment.