Переглянути джерело

Curve editor: minor UI improvements

trethaller 6 роки тому
батько
коміт
abbda7c57b
3 змінених файлів з 7 додано та 17 видалено
  1. 2 1
      bin/style.css
  2. 2 1
      bin/style.less
  3. 3 15
      hide/comp/CurveEditor.hx

+ 2 - 1
bin/style.css

@@ -774,7 +774,7 @@ input[type=checkbox]:checked:after {
 }
 .fx-animpanel .track .track-header .dopesheet {
   position: relative;
-  height: 100%;
+  height: 20px;
   flex-grow: 1;
   background: #333;
   box-shadow: 0px -1px 0px black inset;
@@ -801,6 +801,7 @@ input[type=checkbox]:checked:after {
 .fx-animpanel .track .curve {
   margin-left: 120px;
   position: relative;
+  box-shadow: 0px -1px 0px black inset;
 }
 .fx-animpanel .track .curves.hidden {
   display: none;

+ 2 - 1
bin/style.less

@@ -856,7 +856,7 @@ input[type=checkbox] {
 			}
 			.dopesheet {
 				position: relative;
-				height: 100%;
+				height: 20px;
 				flex-grow: 1;
 				background: #333;
 				box-shadow: 0px -1px 0px black inset;
@@ -884,6 +884,7 @@ input[type=checkbox] {
 		.curve {
 			margin-left: @leftPanelWidth;
 			position: relative;
+			box-shadow: 0px -1px 0px black inset;
 		}
 		.curves.hidden {
 			display: none;

+ 3 - 15
hide/comp/CurveEditor.hx

@@ -364,18 +364,6 @@ class CurveEditor extends Component {
 	}
 
 	public function refresh(?anim: Bool) {
-		if(false) {
-			// Auto-gc
-			if(refreshTimer != null)
-				refreshTimer.stop();
-			if(!anim) {
-				refreshTimer = haxe.Timer.delay(function() {
-					refreshTimer = null;
-					untyped window.gc();
-				}, 500);
-			}
-		}
-
 		refreshGrid();
 		refreshGraph(anim);
 		if(!anim)
@@ -401,8 +389,8 @@ class CurveEditor extends Component {
 		var minY = Math.floor(iyt(height));
 		var maxY = Math.ceil(iyt(0));
 		var vgrid = svg.group(gridGroup, "vgrid");
-		var vstep = 1;
-		while((maxY - minY) / vstep > 10)
+		var vstep = 0.1;
+		while((maxY - minY) / vstep > 20)
 			vstep *= 10;
 
 		inline function hline(iy) {
@@ -422,7 +410,7 @@ class CurveEditor extends Component {
 			var l = hline(iy);
 			if(iy == 0)
 				l.addClass("axis");
-			hlabel("" + iy, iy);
+			hlabel("" + hxd.Math.fmt(iy), iy);
 		}
 	}