소스 검색

Props: Display vectors in rows

trethaller 7 년 전
부모
커밋
d7c0174b1a
3개의 변경된 파일9개의 추가작업 그리고 4개의 파일을 삭제
  1. 3 0
      bin/style.css
  2. 4 0
      bin/style.less
  3. 2 4
      hide/comp/PropsEditor.hx

+ 3 - 0
bin/style.css

@@ -555,6 +555,9 @@ input[type=checkbox]:checked:after {
 .hide-properties .error {
 .hide-properties .error {
   color: red;
   color: red;
 }
 }
+.hide-properties .vector {
+  flex-direction: row;
+}
 /* Curve editor */
 /* Curve editor */
 .hide-curve-editor:focus {
 .hide-curve-editor:focus {
   background-color: rgba(0, 0, 0, 0.219);
   background-color: rgba(0, 0, 0, 0.219);

+ 4 - 0
bin/style.less

@@ -604,6 +604,10 @@ input[type=checkbox] {
 		color: red;
 		color: red;
 	}
 	}
 
 
+	.vector {
+		flex-direction: row;
+	}
+
 }
 }
 
 
 /* Curve editor */
 /* Curve editor */

+ 2 - 4
hide/comp/PropsEditor.hx

@@ -58,11 +58,9 @@ class PropsEditor extends Component {
 				new Element('<input type="color" field="${p.name}">').appendTo(parent);
 				new Element('<input type="color" field="${p.name}">').appendTo(parent);
 			}
 			}
 			else {
 			else {
-				var names = isColor ? ["r", "g", "b", "a"] : ["x", "y", "z", "w"];
+				var row = new Element('<div class="flex"/>').appendTo(parent);
 				for( i in 0...n ) {
 				for( i in 0...n ) {
-					var div = new Element('<div>').appendTo(parent);
-					new Element('<span>${names[i]} </span>').appendTo(div);
-					var e = new Element('<input type="range" class="small" field="${p.name}.$i">').appendTo(div);
+					var e = new Element('<input type="number" field="${p.name}.$i">').appendTo(row);
 					if(min == null) min = isColor ? 0.0 : -1.0;
 					if(min == null) min = isColor ? 0.0 : -1.0;
 					if(max == null)	max = 1.0;
 					if(max == null)	max = 1.0;
 					e.attr("min", "" + min);
 					e.attr("min", "" + min);