Pārlūkot izejas kodu

Changing component visibility should not rescale images.

David Piuva 3 gadi atpakaļ
vecāks
revīzija
b4d67463e9

+ 3 - 2
Source/DFPSR/gui/components/Button.cpp

@@ -126,6 +126,7 @@ void Button::changedLocation(const IRect &oldLocation, const IRect &newLocation)
 }
 }
 
 
 void Button::changedAttribute(const ReadableString &name) {
 void Button::changedAttribute(const ReadableString &name) {
-	// If an attribute has changed then force the image to be redrawn
-	this->hasImages = false;
+	if (!string_caseInsensitiveMatch(name, U"Visible")) {
+		this->hasImages = false;
+	}
 }
 }

+ 3 - 2
Source/DFPSR/gui/components/ListBox.cpp

@@ -262,8 +262,9 @@ void ListBox::changedLocation(const IRect &oldLocation, const IRect &newLocation
 }
 }
 
 
 void ListBox::changedAttribute(const ReadableString &name) {
 void ListBox::changedAttribute(const ReadableString &name) {
-	// If an attribute has changed then force the image to be redrawn
-	this->hasImages = false;
+	if (!string_caseInsensitiveMatch(name, U"Visible")) {
+		this->hasImages = false;
+	}
 	if (string_caseInsensitiveMatch(name, U"List")) {
 	if (string_caseInsensitiveMatch(name, U"List")) {
 		// Reset selection on full list updates
 		// Reset selection on full list updates
 		this->setSelectedIndex(0, true);
 		this->setSelectedIndex(0, true);

+ 3 - 2
Source/DFPSR/gui/components/Panel.cpp

@@ -89,6 +89,7 @@ void Panel::changedLocation(const IRect &oldLocation, const IRect &newLocation)
 }
 }
 
 
 void Panel::changedAttribute(const ReadableString &name) {
 void Panel::changedAttribute(const ReadableString &name) {
-	// If an attribute has changed then force the image to be redrawn
-	this->hasImages = false;
+	if (!string_caseInsensitiveMatch(name, U"Visible")) {
+		this->hasImages = false;
+	}
 }
 }

+ 3 - 2
Source/DFPSR/gui/components/Picture.cpp

@@ -107,6 +107,7 @@ void Picture::changedLocation(const IRect &oldLocation, const IRect &newLocation
 }
 }
 
 
 void Picture::changedAttribute(const ReadableString &name) {
 void Picture::changedAttribute(const ReadableString &name) {
-	// If an attribute has changed then force the image to be redrawn
-	this->hasImages = false;
+	if (!string_caseInsensitiveMatch(name, U"Visible")) {
+		this->hasImages = false;
+	}
 }
 }