Просмотр исходного кода

fix zoom all with curve editor components

lviguier 1 год назад
Родитель
Сommit
e47999021d
1 измененных файлов с 3 добавлено и 1 удалено
  1. 3 1
      hide/comp/CurveEditor.hx

+ 3 - 1
hide/comp/CurveEditor.hx

@@ -849,7 +849,9 @@ class CurveEditor extends Component {
 	}
 
 	public function setYZoom(yMin: Float, yMax: Float) {
-		var margin = 20.0;
+		// If there is some components attached to curve, it takes some place
+		// on svg, so we add bigger margin on Y axis.
+		var margin = this.components.length == 0 ? 30.0 : 60.0;
 		yScale = (height - margin * 2.0) / (yMax - yMin);
 		yOffset = (yMax + yMin) * 0.5;
 	}