Fixed Node2D/Control not updating properties
This commit is contained in:
@@ -63,9 +63,10 @@ void Node2D::edit_set_state(const Variant &p_state) {
|
||||
angle = state[1];
|
||||
_scale = state[2];
|
||||
_update_transform();
|
||||
_change_notify("transform/rot");
|
||||
_change_notify("transform/scale");
|
||||
_change_notify("transform/pos");
|
||||
_change_notify("rotation");
|
||||
_change_notify("rotation_deg");
|
||||
_change_notify("scale");
|
||||
_change_notify("position");
|
||||
}
|
||||
|
||||
void Node2D::edit_set_rect(const Rect2 &p_edit_rect) {
|
||||
@@ -95,15 +96,16 @@ void Node2D::edit_set_rect(const Rect2 &p_edit_rect) {
|
||||
_scale *= new_scale;
|
||||
|
||||
_update_transform();
|
||||
_change_notify("transform/scale");
|
||||
_change_notify("transform/pos");
|
||||
_change_notify("scale");
|
||||
_change_notify("position");
|
||||
}
|
||||
|
||||
void Node2D::edit_rotate(float p_rot) {
|
||||
|
||||
angle += p_rot;
|
||||
_update_transform();
|
||||
_change_notify("transform/rot");
|
||||
_change_notify("rotation");
|
||||
_change_notify("rotation_deg");
|
||||
}
|
||||
|
||||
void Node2D::_update_xform_values() {
|
||||
@@ -134,7 +136,7 @@ void Node2D::set_position(const Point2 &p_pos) {
|
||||
((Node2D *)this)->_update_xform_values();
|
||||
pos = p_pos;
|
||||
_update_transform();
|
||||
_change_notify("transform/pos");
|
||||
_change_notify("position");
|
||||
}
|
||||
|
||||
void Node2D::set_rotation(float p_radians) {
|
||||
@@ -143,7 +145,8 @@ void Node2D::set_rotation(float p_radians) {
|
||||
((Node2D *)this)->_update_xform_values();
|
||||
angle = p_radians;
|
||||
_update_transform();
|
||||
_change_notify("transform/rot");
|
||||
_change_notify("rotation");
|
||||
_change_notify("rotation_deg");
|
||||
}
|
||||
|
||||
void Node2D::set_rotation_in_degrees(float p_degrees) {
|
||||
@@ -169,7 +172,7 @@ void Node2D::set_scale(const Size2 &p_scale) {
|
||||
if (_scale.y == 0)
|
||||
_scale.y = CMP_EPSILON;
|
||||
_update_transform();
|
||||
_change_notify("transform/scale");
|
||||
_change_notify("scale");
|
||||
}
|
||||
|
||||
Point2 Node2D::get_position() const {
|
||||
@@ -349,6 +352,7 @@ void Node2D::set_z(int p_z) {
|
||||
ERR_FAIL_COND(p_z > VS::CANVAS_ITEM_Z_MAX);
|
||||
z = p_z;
|
||||
VS::get_singleton()->canvas_item_set_z(get_canvas_item(), z);
|
||||
_change_notify("z");
|
||||
}
|
||||
|
||||
void Node2D::set_z_as_relative(bool p_enabled) {
|
||||
|
||||
Reference in New Issue
Block a user