From a3f669fb08d4b11064bdf5a0a01aabd3956719cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89milie=20Feral?= Date: Tue, 23 Apr 2019 11:14:39 +0200 Subject: [PATCH] [escher] TextView: avoid useless markRectAsDirty when updating backgroundColor and textColor --- escher/src/text_view.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/escher/src/text_view.cpp b/escher/src/text_view.cpp index b8bc1b8e9..384b81ea3 100644 --- a/escher/src/text_view.cpp +++ b/escher/src/text_view.cpp @@ -1,13 +1,17 @@ #include void TextView::setBackgroundColor(KDColor backgroundColor) { - m_backgroundColor = backgroundColor; - markRectAsDirty(bounds()); + if (m_backgroundColor != backgroundColor) { + m_backgroundColor = backgroundColor; + markRectAsDirty(bounds()); + } } void TextView::setTextColor(KDColor textColor) { - m_textColor = textColor; - markRectAsDirty(bounds()); + if (m_textColor != textColor) { + m_textColor = textColor; + markRectAsDirty(bounds()); + } } void TextView::setAlignment(float horizontalAlignment, float verticalAlignment) {