Browse Source

Bugfix: GUIColorGradient should not attempt to create a zero sized texture
- Also removing some leftover debug logs

BearishSun 6 years ago
parent
commit
faa491d70b

+ 1 - 1
Source/EditorCore/GUI/BsGUIColorGradient.cpp

@@ -166,7 +166,7 @@ namespace bs
 
 	HTexture GUIColorGradient::generateGradientTexture(const ColorGradient& gradient, UINT32 width, bool alpha)
 	{
-		SPtr<PixelData> pixelData = PixelData::create(width, 1, 1, PF_RGBA8);
+		SPtr<PixelData> pixelData = PixelData::create(std::max(width, 1U), 1, 1, PF_RGBA8);
 
 		const float halfPixel = 0.5f / width;
 		for (UINT32 i = 0; i < width; i++)

+ 0 - 2
Source/EditorManaged/Windows/Animation/GUICurveEditor.cs

@@ -1347,7 +1347,6 @@ namespace bs.Editor
             if (scroll != 0.0f)
             {
                 Rect2I elementBounds = mainPanel.ScreenBounds;
-                Debug.Log(elementBounds + " " + Input.PointerPosition);
                 Vector2I pointerPos = Input.PointerPosition - new Vector2I(elementBounds.x, elementBounds.y);
 
                 Vector2 curvePos;
@@ -1618,7 +1617,6 @@ namespace bs.Editor
             Rect2I drawingBounds = drawingPanel.Bounds;
             Vector2I drawingPos = pointerPos - new Vector2I(drawingBounds.x, drawingBounds.y);
 
-            Debug.Log(pointerPos + " " + drawingPos);
             return guiCurveDrawing.PixelToCurveSpace(drawingPos, out curveCoord);
         }