Normand Briere
2019-05-05 631719825b865aaf9fa1cb124d9fc5bd9dd78bd4
Object3D.java
....@@ -2477,13 +2477,13 @@
24772477 return retval;
24782478 }
24792479
2480
- void doEditDrag(ClickInfo info)
2480
+ void doEditDrag(ClickInfo info, boolean opposite)
24812481 {
24822482 switch (doSomething)
24832483 {
24842484 case 1: // '\001'
24852485 //super.
2486
- doEditDrag0(info);
2486
+ doEditDrag0(info, opposite);
24872487 break;
24882488
24892489 case 2: // '\002'
....@@ -2496,11 +2496,11 @@
24962496 {
24972497 //sel.hitSomething = childToDrag.hitSomething;
24982498 //childToDrag.doEditDrag(info);
2499
- sel.doEditDrag(info);
2499
+ sel.doEditDrag(info, opposite);
25002500 } else
25012501 {
25022502 //super.
2503
- doEditDrag0(info);
2503
+ doEditDrag0(info, opposite);
25042504 }
25052505 }
25062506 break;
....@@ -5159,10 +5159,34 @@
51595159
51605160 // System.out.println("Fullname = " + fullname);
51615161
5162
- if (fullname.name.indexOf(":") == -1)
5163
- return fullname.name;
5162
+ // Does not work on Windows due to C:
5163
+// if (fullname.name.indexOf(":") == -1)
5164
+// return fullname.name;
5165
+//
5166
+// return fullname.name.substring(0,fullname.name.indexOf(":"));
51645167
5165
- return fullname.name.substring(0,fullname.name.indexOf(":"));
5168
+ String[] split = fullname.name.split(":");
5169
+
5170
+ if (split.length == 0)
5171
+ {
5172
+ return "";
5173
+ }
5174
+
5175
+ if (split.length <= 2)
5176
+ {
5177
+ if (fullname.name.endsWith(":"))
5178
+ {
5179
+ // Windows
5180
+ return fullname.name.substring(0, fullname.name.length()-1);
5181
+ }
5182
+
5183
+ return split[0];
5184
+ }
5185
+
5186
+ // Windows
5187
+ assert(split.length == 4);
5188
+
5189
+ return split[0] + ":" + split[1];
51665190 }
51675191
51685192 static String GetBump(cTexture fullname)
....@@ -5171,10 +5195,38 @@
51715195 return "";
51725196
51735197 // System.out.println("Fullname = " + fullname);
5174
- if (fullname.name.indexOf(":") == -1)
5175
- return "";
5176
-
5177
- return fullname.name.substring(fullname.name.indexOf(":")+1,fullname.name.length());
5198
+ // Does not work on Windows due to C:
5199
+// if (fullname.name.indexOf(":") == -1)
5200
+// return "";
5201
+//
5202
+// return fullname.name.substring(fullname.name.indexOf(":")+1,fullname.name.length());
5203
+ String[] split = fullname.name.split(":");
5204
+
5205
+ if (split.length == 0)
5206
+ {
5207
+ return "";
5208
+ }
5209
+
5210
+ if (split.length == 1)
5211
+ {
5212
+ return "";
5213
+ }
5214
+
5215
+ if (split.length == 2)
5216
+ {
5217
+ if (fullname.name.endsWith(":"))
5218
+ {
5219
+ // Windows
5220
+ return "";
5221
+ }
5222
+
5223
+ return split[1];
5224
+ }
5225
+
5226
+ // Windows
5227
+ assert(split.length == 4);
5228
+
5229
+ return split[2] + ":" + split[3];
51785230 }
51795231
51805232 String GetPigmentTexture()
....@@ -5248,7 +5300,7 @@
52485300 System.out.print("; textures = " + textures);
52495301 System.out.println("; usedtextures = " + usedtextures);
52505302
5251
- if (GetTextures() == null)
5303
+ if (GetTextures() == null) // What is that??
52525304 GetTextures().name = ":";
52535305
52545306 String texname = tex;
....@@ -6932,7 +6984,7 @@
69326984 }
69336985
69346986 //System.out.println("info.modifiers = " + info.modifiers);
6935
- modified = (info.modifiers & CameraPane.META) != 0;
6987
+ modified = (info.modifiers & CameraPane.SHIFT) != 0; // Was META
69366988 //System.out.println("modified = " + modified);
69376989 //new Exception().printStackTrace();
69386990 //viewCode = info.pane.renderCamera.viewCode;
....@@ -6960,7 +7012,7 @@
69607012 return true;
69617013 }
69627014
6963
- void doEditDrag0(ClickInfo info)
7015
+ void doEditDrag0(ClickInfo info, boolean opposite)
69647016 {
69657017 if (hitSomething == 0)
69667018 {
....@@ -6987,7 +7039,7 @@
69877039
69887040 scale *= 0.05f * Globals.theRenderer.RenderCamera().Distance();
69897041
6990
- if (modified)
7042
+ if (modified || opposite)
69917043 {
69927044 //assert(false);
69937045 /*
....@@ -7081,6 +7133,7 @@
70817133
70827134 if (modified)
70837135 {
7136
+ // Rotate 90 degrees
70847137 angle /= (Math.PI / 4);
70857138 angle = Math.floor(angle + 0.5);
70867139 angle *= (Math.PI / 4);