Merge pull request #31839 from Calinou/canvasitem-update-only-if-needed
Call some CanvasItem property setters only if needed
This commit is contained in:
commit
979e772947
1 changed files with 9 additions and 0 deletions
|
@ -641,6 +641,9 @@ void CanvasItem::update() {
|
|||
|
||||
void CanvasItem::set_modulate(const Color &p_modulate) {
|
||||
|
||||
if (modulate == p_modulate)
|
||||
return;
|
||||
|
||||
modulate = p_modulate;
|
||||
VisualServer::get_singleton()->canvas_item_set_modulate(canvas_item, modulate);
|
||||
}
|
||||
|
@ -679,6 +682,9 @@ CanvasItem *CanvasItem::get_parent_item() const {
|
|||
|
||||
void CanvasItem::set_self_modulate(const Color &p_self_modulate) {
|
||||
|
||||
if (self_modulate == p_self_modulate)
|
||||
return;
|
||||
|
||||
self_modulate = p_self_modulate;
|
||||
VisualServer::get_singleton()->canvas_item_set_self_modulate(canvas_item, self_modulate);
|
||||
}
|
||||
|
@ -689,6 +695,9 @@ Color CanvasItem::get_self_modulate() const {
|
|||
|
||||
void CanvasItem::set_light_mask(int p_light_mask) {
|
||||
|
||||
if (light_mask == p_light_mask)
|
||||
return;
|
||||
|
||||
light_mask = p_light_mask;
|
||||
VS::get_singleton()->canvas_item_set_light_mask(canvas_item, p_light_mask);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue