Quellcode durchsuchen

Merge pull request #16347 from Chaosus/gradientpreviewfix

Fix gradient texture preview
Poommetee Ketson vor 7 Jahren
Ursprung
Commit
4ab522799d
1 geänderte Dateien mit 3 neuen und 0 gelöschten Zeilen
  1. 3 0
      editor/plugins/texture_editor_plugin.cpp

+ 3 - 0
editor/plugins/texture_editor_plugin.cpp

@@ -75,6 +75,9 @@ void TextureEditor::_notification(int p_what) {
 			// In the case of CurveTextures we know they are 1 in height, so fill the preview to see the gradient
 			ofs_y = 0;
 			tex_height = size.height;
+		} else if (Object::cast_to<GradientTexture>(*texture)) {
+			ofs_y = size.height / 4.0;
+			tex_height = size.height / 2.0;
 		}
 
 		draw_texture_rect(texture, Rect2(ofs_x, ofs_y, tex_width, tex_height));