Skip to content

Commit

Permalink
Override layoutcomponent x/y using layoutX/Y
Browse files Browse the repository at this point in the history
Duo called out a bug where a translation constraint applied to a layout component behaved differently in editor vs runtime. The issue was due to the constraint using x/y properties, whereas layoutX/Y should be used for layout components. Added an override to fix this.

Checked other usages of x/y() in CPP and currently, the only place they are used that is applicable to layout components is in constraints and ListenerAlignTarget.

Diffs=
e8d6e5db26 Override layoutcomponent x/y using layoutX/Y (#8714)

Co-authored-by: Philip Chung <philterdesign@gmail.com>
  • Loading branch information
philter and philter committed Dec 9, 2024
1 parent bb5173a commit 2b721a5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .rive_head
Original file line number Diff line number Diff line change
@@ -1 +1 @@
d3f6a49778aa6ce7408aecededeb1afc1bf33e6e
e8d6e5db26279ca460b46161df84c77f73903a95
6 changes: 4 additions & 2 deletions include/rive/layout_component.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,10 @@ class LayoutComponent : public LayoutComponentBase,
m_layout.height());
}

float layoutX() { return m_layout.left(); }
float layoutY() { return m_layout.top(); }
float x() const override { return layoutX(); }
float y() const override { return layoutY(); }
float layoutX() const { return m_layout.left(); }
float layoutY() const { return m_layout.top(); }
float layoutWidth() { return m_layout.width(); }
float layoutHeight() { return m_layout.height(); }
float innerWidth()
Expand Down

0 comments on commit 2b721a5

Please sign in to comment.