Simplify Control internal transform calculation
This commit is contained in:
parent
1bd740d18d
commit
5be4eb9fc6
@ -682,12 +682,10 @@ Size2 Control::get_parent_area_size() const {
|
|||||||
// Positioning and sizing.
|
// Positioning and sizing.
|
||||||
|
|
||||||
Transform2D Control::_get_internal_transform() const {
|
Transform2D Control::_get_internal_transform() const {
|
||||||
Transform2D rot_scale;
|
// T(pivot_offset) * R(rotation) * S(scale) * T(-pivot_offset)
|
||||||
rot_scale.set_rotation_and_scale(data.rotation, data.scale);
|
Transform2D xform(data.rotation, data.scale, 0.0f, data.pivot_offset);
|
||||||
Transform2D offset;
|
xform.translate_local(-data.pivot_offset);
|
||||||
offset.set_origin(-data.pivot_offset);
|
return xform;
|
||||||
|
|
||||||
return offset.affine_inverse() * (rot_scale * offset);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Control::_update_canvas_item_transform() {
|
void Control::_update_canvas_item_transform() {
|
||||||
|
Loading…
Reference in New Issue
Block a user