[escher] TextView: avoid useless markRectAsDirty when updating

backgroundColor and textColor
This commit is contained in:
Émilie Feral
2019-04-23 11:14:39 +02:00
parent 80078137d5
commit a3f669fb08

View File

@@ -1,13 +1,17 @@
#include <escher/text_view.h>
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) {