Selaa lähdekoodia

fix curve inspector

lviguier 1 vuosi sitten
vanhempi
commit
95284f66ea
5 muutettua tiedostoa jossa 51 lisäystä ja 42 poistoa
  1. 21 17
      bin/style.css
  2. 25 21
      bin/style.less
  3. 3 1
      hide/comp/CurveEditor.hx
  4. 0 3
      hide/view/Prefab.hx
  5. 2 0
      hrt/prefab/Curve.hx

+ 21 - 17
bin/style.css

@@ -1136,6 +1136,27 @@ input[type=checkbox]:checked:after {
   position: relative;
   position: relative;
   background-color: #303030;
   background-color: #303030;
 }
 }
+.hide-curve-editor .timeline {
+  background: #161616;
+  fill: #161616;
+  position: relative;
+  height: 20px;
+  overflow: hidden;
+}
+.hide-curve-editor .timeline .tlgroup .mark {
+  height: 100%;
+  color: #8e8e8e;
+  border-left: 1px solid #8e8e8e;
+  vertical-align: middle;
+  padding-left: 4px;
+  position: absolute;
+  line-height: 20px;
+  user-select: none;
+}
+.hide-curve-editor text {
+  font: 10px sans-serif;
+  fill: #8d8d8d;
+}
 .hide-curve-editor:focus {
 .hide-curve-editor:focus {
   outline: none;
   outline: none;
 }
 }
@@ -1326,23 +1347,6 @@ input[type=checkbox]:checked:after {
 .fx-animpanel .key-event:hover.selected {
 .fx-animpanel .key-event:hover.selected {
   fill: #ffbe33;
   fill: #ffbe33;
 }
 }
-.fx-animpanel .timeline {
-  background: #161616;
-  fill: #161616;
-  position: relative;
-  height: 20px;
-  overflow: hidden;
-}
-.fx-animpanel .timeline .tlgroup .mark {
-  height: 100%;
-  color: #8e8e8e;
-  border-left: 1px solid #8e8e8e;
-  vertical-align: middle;
-  padding-left: 4px;
-  position: absolute;
-  line-height: 20px;
-  user-select: none;
-}
 .fx-animpanel text {
 .fx-animpanel text {
   font: 10px sans-serif;
   font: 10px sans-serif;
   fill: #8d8d8d;
   fill: #8d8d8d;

+ 25 - 21
bin/style.less

@@ -1223,10 +1223,35 @@ input[type=checkbox] {
 }
 }
 
 
 /* Curve editor */
 /* Curve editor */
+@timelineHeight: 20px;
 .hide-curve-editor {
 .hide-curve-editor {
 	position: relative;
 	position: relative;
 	background-color: #303030;
 	background-color: #303030;
 
 
+	.timeline {
+		background: #161616;
+		fill: #161616;
+		position: relative;
+		height: @timelineHeight;
+		overflow: hidden;
+
+		.tlgroup .mark {
+			height: 100%;
+			color: #8e8e8e;
+			border-left: 1px solid #8e8e8e;
+			vertical-align: middle;
+			padding-left: 4px;
+			position: absolute;
+			line-height: @timelineHeight;
+			user-select: none;
+		}
+
+	}
+
+	text {
+		font: 10px sans-serif; fill: #8d8d8d;
+	}
+
 	&:focus {
 	&:focus {
 		//background-color: rgba(0, 0, 0, 0.219);
 		//background-color: rgba(0, 0, 0, 0.219);
 		outline: none;
 		outline: none;
@@ -1357,7 +1382,6 @@ input[type=checkbox] {
 
 
 .fx-animpanel {
 .fx-animpanel {
 	@leftPanelWidth: 200px;
 	@leftPanelWidth: 200px;
-	@timelineHeight: 20px;
 	min-height: 120px;
 	min-height: 120px;
 	max-height: 800px;
 	max-height: 800px;
 	position: relative;
 	position: relative;
@@ -1444,26 +1468,6 @@ input[type=checkbox] {
 	.key-event.selected, .key-event:hover.selected {
 	.key-event.selected, .key-event:hover.selected {
 		fill: #ffbe33;
 		fill: #ffbe33;
 	}
 	}
-
-	.timeline {
-		background: #161616;
-		fill: #161616;
-		position: relative;
-		height: @timelineHeight;
-		overflow: hidden;
-
-		.tlgroup .mark {
-			height: 100%;
-			color: #8e8e8e;
-			border-left: 1px solid #8e8e8e;
-			vertical-align: middle;
-			padding-left: 4px;
-			position: absolute;
-			line-height: @timelineHeight;
-			user-select: none;
-		}
-
-	}
 	
 	
 	text {
 	text {
 		font: 10px sans-serif; fill: #8d8d8d;
 		font: 10px sans-serif; fill: #8d8d8d;

+ 3 - 1
hide/comp/CurveEditor.hx

@@ -184,7 +184,7 @@ class OverviewEditor extends Component implements CurveEditorComponent
 			overviewGroup.remove();
 			overviewGroup.remove();
 		} 
 		} 
 
 
-		overviewGroup = svg.group(svg.element, "overview");
+		overviewGroup = svg.group(this.curveEditor.componentsGroup, "overview");
 		
 		
 		var overview = svg.rect(overviewGroup, 0, tlHeight, width, overviewHeight);
 		var overview = svg.rect(overviewGroup, 0, tlHeight, width, overviewHeight);
 		overviewKeys = svg.group(overviewGroup, "overview-keys");
 		overviewKeys = svg.group(overviewGroup, "overview-keys");
@@ -367,6 +367,7 @@ class CurveEditor extends Component {
 	public var maxValue : Float = 0.;
 	public var maxValue : Float = 0.;
 
 
 	public var components : Array<CurveEditorComponent> = [];
 	public var components : Array<CurveEditorComponent> = [];
+	public var componentsGroup : Element;
 	
 	
 	var svg : hide.comp.SVG;
 	var svg : hide.comp.SVG;
 	var width = 0;
 	var width = 0;
@@ -406,6 +407,7 @@ class CurveEditor extends Component {
 		graphGroup = svg.group(root, "graph");
 		graphGroup = svg.group(root, "graph");
 		overlayGroup = svg.group(root, "overlaygroup");
 		overlayGroup = svg.group(root, "overlaygroup");
 		selectGroup = svg.group(root, "selection-overlay");
 		selectGroup = svg.group(root, "selection-overlay");
+		componentsGroup = svg.group(root, "components");
 		tlGroup = svg.group(root, "tlgroup");
 		tlGroup = svg.group(root, "tlgroup");
 		markersGroup = svg.group(root, "markers").css({'pointer-events':'none'});
 		markersGroup = svg.group(root, "markers").css({'pointer-events':'none'});
 
 

+ 0 - 3
hide/view/Prefab.hx

@@ -377,9 +377,6 @@ class Prefab extends FileView {
 		statusText.setPosition(5, 5);
 		statusText.setPosition(5, 5);
 		statusText.visible = false;
 		statusText.visible = false;
 
 
-
-
-
 		/*gridStep = @:privateAccess sceneEditor.gizmo.moveStep;*/
 		/*gridStep = @:privateAccess sceneEditor.gizmo.moveStep;*/
 		sceneEditor.updateGrid = function() {
 		sceneEditor.updateGrid = function() {
 			updateGrid();
 			updateGrid();

+ 2 - 0
hrt/prefab/Curve.hx

@@ -301,7 +301,9 @@ class Curve extends Prefab {
 		});
 		});
 
 
 		var ce = new hide.comp.CurveEditor(ctx.properties.undo, ctx.properties.element);
 		var ce = new hide.comp.CurveEditor(ctx.properties.undo, ctx.properties.element);
+		ce.saveDisplayKey = this.getAbsPath(true);
 		ce.curves.push(this);
 		ce.curves.push(this);
+		ce.refresh();
 	}
 	}
 
 
 	override function getHideProps() : HideProps {
 	override function getHideProps() : HideProps {