Ver Fonte

[gradients] Reverted changes on Constant gradients and fixed editor

Clement Espeute há 1 ano atrás
pai
commit
98334091f5
2 ficheiros alterados com 2 adições e 3 exclusões
  1. 1 2
      hide/comp/GradientEditor.hx
  2. 1 1
      hrt/impl/Gradient.hx

+ 1 - 2
hide/comp/GradientEditor.hx

@@ -388,8 +388,7 @@ class GradientEditor extends Popup {
             var x : Float = stop.position;
             var y : Float = 0.5;
             marquer.attr("transform", 'translate(${x}, ${y})');
-
-            Gradient.evalData(innerValue, stop.position, vector);
+			vector.setColor(stop.color);
             marquer.children(".fill").attr({fill: 'rgba(${vector.r*255.0}, ${vector.g*255.0}, ${vector.b*255.0}, ${vector.a})'});
         }
 

+ 1 - 1
hrt/impl/Gradient.hx

@@ -81,7 +81,7 @@ class Gradient {
                     outVector.x = lerp_angle(start.x, end.x, blend);
                 }
             case Constant:
-                outVector.load(blend < 0.5 ? start : end);
+                outVector.load(start);
             case Cubic:
                 // Honteusement copié de https://github.com/godotengine/godot/blob/c241f1c52386b21cf2df936ee927740a06970db6/scene/resources/gradient.h#L159
                 var i0 = firstStopIdx-1;