.. | .. |
---|
22 | 22 | //static final long serialVersionUID = -607422624994562685L; |
---|
23 | 23 | static final long serialVersionUID = 5022536242724664900L; |
---|
24 | 24 | |
---|
| 25 | + // Use GetUUID for backward compatibility with null. |
---|
25 | 26 | private UUID uuid = UUID.randomUUID(); |
---|
26 | 27 | |
---|
27 | 28 | // TEMPORARY for mocap undo. No need to be transient. |
---|
.. | .. |
---|
32 | 33 | String skyboxname; |
---|
33 | 34 | String skyboxext; |
---|
34 | 35 | |
---|
35 | | - byte[] versions[]; |
---|
| 36 | + Object3D versionlist[]; |
---|
36 | 37 | int versionindex = -1; |
---|
37 | 38 | |
---|
| 39 | + java.util.Hashtable<java.util.UUID, Object3D> versiontable; // = new java.util.Hashtable<java.util.UUID, Object3D>(); |
---|
| 40 | + |
---|
38 | 41 | ScriptNode scriptnode; |
---|
39 | 42 | |
---|
40 | 43 | void InitOthers() |
---|
.. | .. |
---|
222 | 225 | // o.bRep.support = null; |
---|
223 | 226 | // } |
---|
224 | 227 | o.selection = this.selection; |
---|
225 | | - o.versions = this.versions; |
---|
| 228 | + o.versionlist = this.versionlist; |
---|
226 | 229 | o.versionindex = this.versionindex; |
---|
227 | 230 | |
---|
228 | 231 | if (this.support != null) |
---|
.. | .. |
---|
244 | 247 | // this.bRep.support = null; |
---|
245 | 248 | // this.support = null; |
---|
246 | 249 | // this.fileparent = null; |
---|
| 250 | + } |
---|
| 251 | + |
---|
| 252 | +// Object3D GetObject(java.util.UUID uuid) |
---|
| 253 | +// { |
---|
| 254 | +// if (this.uuid.equals(uuid)) |
---|
| 255 | +// return this; |
---|
| 256 | +// |
---|
| 257 | +// if (blockloop) |
---|
| 258 | +// return null; |
---|
| 259 | +// |
---|
| 260 | +// blockloop = true; |
---|
| 261 | +// |
---|
| 262 | +// for (int i=0; i<Size(); i++) |
---|
| 263 | +// { |
---|
| 264 | +// Object3D o = get(i).GetObject(uuid); |
---|
| 265 | +// |
---|
| 266 | +// if (o != null) |
---|
| 267 | +// return o; |
---|
| 268 | +// } |
---|
| 269 | +// |
---|
| 270 | +// blockloop = false; |
---|
| 271 | +// |
---|
| 272 | +// return null; |
---|
| 273 | +// } |
---|
| 274 | + |
---|
| 275 | + transient boolean tag; |
---|
| 276 | + |
---|
| 277 | + void TagObjects(Object3D o, boolean tag) |
---|
| 278 | + { |
---|
| 279 | + if (blockloop) |
---|
| 280 | + return; |
---|
| 281 | + |
---|
| 282 | + o.tag = tag; |
---|
| 283 | + |
---|
| 284 | + if (o == this) |
---|
| 285 | + return; |
---|
| 286 | + |
---|
| 287 | + blockloop = true; |
---|
| 288 | + |
---|
| 289 | + for (int i=0; i<Size(); i++) |
---|
| 290 | + { |
---|
| 291 | + get(i).TagObjects(o, tag); |
---|
| 292 | + } |
---|
| 293 | + |
---|
| 294 | + blockloop = false; |
---|
| 295 | + } |
---|
| 296 | + |
---|
| 297 | + boolean HasTags() |
---|
| 298 | + { |
---|
| 299 | + if (blockloop) |
---|
| 300 | + return false; |
---|
| 301 | + |
---|
| 302 | + blockloop = true; |
---|
| 303 | + |
---|
| 304 | + boolean hasTags = false; |
---|
| 305 | + |
---|
| 306 | + for (int i=0; i<Size(); i++) |
---|
| 307 | + { |
---|
| 308 | + hasTags |= get(i).tag || get(i).HasTags(); |
---|
| 309 | + |
---|
| 310 | + if (hasTags) |
---|
| 311 | + break; |
---|
| 312 | + } |
---|
| 313 | + |
---|
| 314 | + blockloop = false; |
---|
| 315 | + |
---|
| 316 | + return hasTags; |
---|
247 | 317 | } |
---|
248 | 318 | |
---|
249 | 319 | void RestoreBigData(java.util.Hashtable<java.util.UUID, Object3D> hashtable) |
---|
.. | .. |
---|
280 | 350 | |
---|
281 | 351 | this.selection = o.selection; |
---|
282 | 352 | |
---|
283 | | - this.versions = o.versions; |
---|
| 353 | + this.versionlist = o.versionlist; |
---|
284 | 354 | this.versionindex = o.versionindex; |
---|
285 | 355 | // July 2019 if (this.bRep != null) |
---|
286 | 356 | // this.bRep.support = o.transientrep; |
---|
.. | .. |
---|
617 | 687 | { |
---|
618 | 688 | if (maxcount != 1) |
---|
619 | 689 | { |
---|
620 | | - new Exception().printStackTrace(); |
---|
| 690 | + //new Exception().printStackTrace(); |
---|
621 | 691 | } |
---|
622 | 692 | |
---|
623 | 693 | toParentMarked = LA.newMatrix(); |
---|
.. | .. |
---|
1014 | 1084 | |
---|
1015 | 1085 | if (material == null || material.multiply) |
---|
1016 | 1086 | return true; |
---|
| 1087 | + |
---|
| 1088 | + if (projectedVertices != null && projectedVertices.length > 2 && projectedVertices[2].y >= 10000) |
---|
| 1089 | + return false; |
---|
1017 | 1090 | |
---|
1018 | 1091 | // Transparent objects are dynamic because we have to sort the triangles. |
---|
1019 | 1092 | return material.opacity > 0.99; |
---|
.. | .. |
---|
2296 | 2369 | |
---|
2297 | 2370 | InitOthers(); |
---|
2298 | 2371 | |
---|
2299 | | - if (this instanceof Camera) |
---|
2300 | | - { |
---|
2301 | | - material.shift = 90; |
---|
2302 | | - } |
---|
2303 | | - |
---|
2304 | 2372 | material.multiply = multiply; |
---|
2305 | 2373 | |
---|
2306 | 2374 | if (multiply) |
---|
.. | .. |
---|
2441 | 2509 | else |
---|
2442 | 2510 | { |
---|
2443 | 2511 | //((ObjEditor)editWindow).SetupUI2(null); |
---|
| 2512 | + if (objectUI != null) |
---|
| 2513 | + ((ObjEditor)objectUI).pinButton.setSelected(pinned); |
---|
| 2514 | + else |
---|
| 2515 | + //new Exception().printStackTrace(); |
---|
| 2516 | + System.err.println("objectUI is null"); |
---|
2444 | 2517 | } |
---|
2445 | 2518 | } |
---|
2446 | 2519 | |
---|
.. | .. |
---|
3544 | 3617 | |
---|
3545 | 3618 | void ClearMaterials() |
---|
3546 | 3619 | { |
---|
| 3620 | + if (blockloop) |
---|
| 3621 | + return; |
---|
| 3622 | + |
---|
| 3623 | + blockloop = true; |
---|
| 3624 | + |
---|
3547 | 3625 | ClearMaterial(); |
---|
3548 | | - for (int i = 0; i < size(); i++) |
---|
| 3626 | + for (int i = 0; i < Size(); i++) |
---|
3549 | 3627 | { |
---|
3550 | | - Object3D child = (Object3D) reserve(i); |
---|
| 3628 | + Object3D child = (Object3D) get(i); |
---|
3551 | 3629 | if (child == null) |
---|
3552 | 3630 | continue; |
---|
3553 | 3631 | child.ClearMaterials(); |
---|
3554 | | - release(i); |
---|
3555 | 3632 | } |
---|
| 3633 | + |
---|
| 3634 | + blockloop = false; |
---|
| 3635 | + } |
---|
| 3636 | + |
---|
| 3637 | + void ClearVersionList() |
---|
| 3638 | + { |
---|
| 3639 | + this.versionlist = null; |
---|
| 3640 | + this.versionindex = -1; |
---|
| 3641 | + this.versiontable = null; |
---|
| 3642 | + } |
---|
| 3643 | + |
---|
| 3644 | + void ClearVersions() |
---|
| 3645 | + { |
---|
| 3646 | + if (blockloop) |
---|
| 3647 | + return; |
---|
| 3648 | + |
---|
| 3649 | + blockloop = true; |
---|
| 3650 | + |
---|
| 3651 | + ClearVersionList(); |
---|
| 3652 | + for (int i = 0; i < Size(); i++) |
---|
| 3653 | + { |
---|
| 3654 | + Object3D child = (Object3D) get(i); |
---|
| 3655 | + if (child == null) |
---|
| 3656 | + continue; |
---|
| 3657 | + child.ClearVersions(); |
---|
| 3658 | + } |
---|
| 3659 | + |
---|
| 3660 | + blockloop = false; |
---|
3556 | 3661 | } |
---|
3557 | 3662 | |
---|
3558 | 3663 | void FlipV(boolean flip) |
---|
.. | .. |
---|
5542 | 5647 | if (fullname == null) |
---|
5543 | 5648 | return ""; |
---|
5544 | 5649 | |
---|
| 5650 | + if (fullname.pigment != null) |
---|
| 5651 | + { |
---|
| 5652 | + return fullname.pigment; |
---|
| 5653 | + } |
---|
| 5654 | + |
---|
5545 | 5655 | // System.out.println("Fullname = " + fullname); |
---|
5546 | 5656 | |
---|
5547 | 5657 | // Does not work on Windows due to C: |
---|
.. | .. |
---|
5554 | 5664 | |
---|
5555 | 5665 | if (split.length == 0) |
---|
5556 | 5666 | { |
---|
5557 | | - return ""; |
---|
| 5667 | + return fullname.pigment = ""; |
---|
5558 | 5668 | } |
---|
5559 | 5669 | |
---|
5560 | 5670 | if (split.length <= 2) |
---|
.. | .. |
---|
5562 | 5672 | if (fullname.name.endsWith(":")) |
---|
5563 | 5673 | { |
---|
5564 | 5674 | // Windows |
---|
5565 | | - return fullname.name.substring(0, fullname.name.length()-1); |
---|
| 5675 | + return fullname.pigment = fullname.name.substring(0, fullname.name.length()-1); |
---|
5566 | 5676 | } |
---|
5567 | 5677 | |
---|
5568 | | - return split[0]; |
---|
| 5678 | + return fullname.pigment = split[0]; |
---|
5569 | 5679 | } |
---|
5570 | 5680 | |
---|
5571 | 5681 | // Windows |
---|
5572 | 5682 | assert(split.length == 4); |
---|
5573 | 5683 | |
---|
5574 | | - return split[0] + ":" + split[1]; |
---|
| 5684 | + return fullname.pigment = split[0] + ":" + split[1]; |
---|
5575 | 5685 | } |
---|
5576 | 5686 | |
---|
5577 | 5687 | static String GetBump(cTexture fullname) |
---|
5578 | 5688 | { |
---|
5579 | 5689 | if (fullname == null) |
---|
5580 | 5690 | return ""; |
---|
| 5691 | + |
---|
| 5692 | + if (fullname.bump != null) |
---|
| 5693 | + { |
---|
| 5694 | + return fullname.bump; |
---|
| 5695 | + } |
---|
5581 | 5696 | |
---|
5582 | 5697 | // System.out.println("Fullname = " + fullname); |
---|
5583 | 5698 | // Does not work on Windows due to C: |
---|
.. | .. |
---|
5589 | 5704 | |
---|
5590 | 5705 | if (split.length == 0) |
---|
5591 | 5706 | { |
---|
5592 | | - return ""; |
---|
| 5707 | + return fullname.bump = ""; |
---|
5593 | 5708 | } |
---|
5594 | 5709 | |
---|
5595 | 5710 | if (split.length == 1) |
---|
5596 | 5711 | { |
---|
5597 | | - return ""; |
---|
| 5712 | + return fullname.bump = ""; |
---|
5598 | 5713 | } |
---|
5599 | 5714 | |
---|
5600 | 5715 | if (split.length == 2) |
---|
.. | .. |
---|
5602 | 5717 | if (fullname.name.endsWith(":")) |
---|
5603 | 5718 | { |
---|
5604 | 5719 | // Windows |
---|
5605 | | - return ""; |
---|
| 5720 | + return fullname.bump = ""; |
---|
5606 | 5721 | } |
---|
5607 | 5722 | |
---|
5608 | | - return split[1]; |
---|
| 5723 | + return fullname.bump = split[1]; |
---|
5609 | 5724 | } |
---|
5610 | 5725 | |
---|
5611 | 5726 | // Windows |
---|
5612 | 5727 | assert(split.length == 4); |
---|
5613 | 5728 | |
---|
5614 | | - return split[2] + ":" + split[3]; |
---|
| 5729 | + return fullname.bump = split[2] + ":" + split[3]; |
---|
5615 | 5730 | } |
---|
5616 | 5731 | |
---|
5617 | 5732 | String GetPigmentTexture() |
---|
.. | .. |
---|
5694 | 5809 | texname = ""; |
---|
5695 | 5810 | |
---|
5696 | 5811 | GetTextures().name = texname + ":" + GetBump(GetTextures()); |
---|
| 5812 | + |
---|
| 5813 | + GetTextures().pigment = null; |
---|
| 5814 | + |
---|
5697 | 5815 | Touch(); |
---|
5698 | 5816 | } |
---|
5699 | 5817 | |
---|
.. | .. |
---|
5766 | 5884 | texname = ""; |
---|
5767 | 5885 | |
---|
5768 | 5886 | GetTextures().name = Object3D.GetPigment(GetTextures()) + ":" + texname; |
---|
| 5887 | + |
---|
| 5888 | + GetTextures().bump = null; |
---|
5769 | 5889 | |
---|
5770 | 5890 | Touch(); |
---|
5771 | 5891 | } |
---|
.. | .. |
---|
5909 | 6029 | if (support != null) |
---|
5910 | 6030 | support = support; |
---|
5911 | 6031 | |
---|
5912 | | - //boolean usecalllists = IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null || !link2master); // !(this instanceof cSpring) && !(this instanceof BezierPatch); |
---|
5913 | | - boolean usecalllists = false; //!IsLive(); // IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null) && !link2master; // !(this instanceof cSpring) && !(this instanceof BezierPatch); |
---|
| 6032 | + boolean usecalllists = !IsLive() && IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null || !link2master); // !(this instanceof cSpring) && !(this instanceof BezierPatch); |
---|
| 6033 | + //boolean usecalllists = false; //!IsLive(); // IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null) && !link2master; // !(this instanceof cSpring) && !(this instanceof BezierPatch); |
---|
| 6034 | + |
---|
| 6035 | + //usecalllists &= display.DrawMode() == display.DEFAULT; // Don't compute list in shadow pass. |
---|
5914 | 6036 | |
---|
5915 | 6037 | if (!usecalllists && bRep != null && bRep.displaylist > 0) |
---|
5916 | 6038 | { |
---|
.. | .. |
---|
5920 | 6042 | // usecalllists &= !(parent instanceof RandomNode); |
---|
5921 | 6043 | // usecalllists = false; |
---|
5922 | 6044 | |
---|
5923 | | - if (GetBRep() != null) |
---|
5924 | | - usecalllists = usecalllists; |
---|
| 6045 | + if (display.DrawMode() == display.SHADOW) |
---|
| 6046 | + //GetBRep() != null) |
---|
| 6047 | + usecalllists = !!usecalllists; |
---|
5925 | 6048 | //System.out.println("draw " + this); |
---|
5926 | 6049 | //new Exception().printStackTrace(); |
---|
5927 | 6050 | |
---|
.. | .. |
---|
5943 | 6066 | if (!(this instanceof Composite)) |
---|
5944 | 6067 | touched = false; |
---|
5945 | 6068 | //if (displaylist == -1 && usecalllists) |
---|
5946 | | - if ((bRep != null && bRep.displaylist <= 0) && usecalllists) // june 2013 |
---|
| 6069 | + if (bRep.displaylist <= 0 && usecalllists) // && display.DrawMode() == display.DEFAULT) // june 2013 |
---|
5947 | 6070 | { |
---|
5948 | 6071 | bRep.displaylist = display.GenList(); |
---|
5949 | 6072 | assert(bRep.displaylist != 0); |
---|
.. | .. |
---|
5954 | 6077 | |
---|
5955 | 6078 | //System.out.println("\tnew list " + list); |
---|
5956 | 6079 | //gl.glDrawBuffer(gl.GL_NONE); |
---|
5957 | | - if (usecalllists) |
---|
| 6080 | + if (usecalllists && bRep.displaylist > 0) |
---|
5958 | 6081 | { |
---|
5959 | 6082 | // System.err.println("new list " + bRep.displaylist + " for " + this); |
---|
5960 | 6083 | display.NewList(bRep.displaylist); |
---|
.. | .. |
---|
5963 | 6086 | CallList(display, root, selected, blocked); |
---|
5964 | 6087 | |
---|
5965 | 6088 | // compiled = true; |
---|
5966 | | - if (usecalllists) |
---|
| 6089 | + if (usecalllists && bRep.displaylist > 0) |
---|
5967 | 6090 | { |
---|
5968 | 6091 | // System.err.println("end list " + bRep.displaylist + " for " + this); |
---|
5969 | 6092 | display.EndList(); |
---|
.. | .. |
---|
7367 | 7490 | boundary.y = spot.y - 30; |
---|
7368 | 7491 | boundary.width = spot.width + 60; |
---|
7369 | 7492 | boundary.height = spot.height + 60; |
---|
7370 | | - clickInfo.g.setColor(Color.red); |
---|
| 7493 | + clickInfo.g.setColor(Color.white); |
---|
7371 | 7494 | int spotw = spot.x + spot.width; |
---|
7372 | 7495 | int spoth = spot.y + spot.height; |
---|
7373 | 7496 | clickInfo.g.fillRect(spot.x, spot.y, spot.width, spot.height); |
---|
.. | .. |
---|
7387 | 7510 | // { |
---|
7388 | 7511 | // CameraPane.Ymax = spoth; |
---|
7389 | 7512 | // } |
---|
7390 | | - spot.translate(32, 32); |
---|
| 7513 | +// if (CameraPane.Xmin > spot.x) |
---|
| 7514 | +// { |
---|
| 7515 | +// CameraPane.Xmin = spot.x; |
---|
| 7516 | +// } |
---|
| 7517 | +// if (CameraPane.Xmax < spotw) |
---|
| 7518 | +// { |
---|
| 7519 | +// CameraPane.Xmax = spotw; |
---|
| 7520 | +// } |
---|
| 7521 | +// if (CameraPane.Ymin > spot.y) |
---|
| 7522 | +// { |
---|
| 7523 | +// CameraPane.Ymin = spot.y; |
---|
| 7524 | +// } |
---|
| 7525 | +// if (CameraPane.Ymax < spoth) |
---|
| 7526 | +// { |
---|
| 7527 | +// CameraPane.Ymax = spoth; |
---|
| 7528 | +// } |
---|
| 7529 | + // bonhommes info.g.drawLine(spotw, spoth, spotw, spoth - boundary.height/2); // 15 |
---|
| 7530 | + //info.g.drawLine(spotw, spoth, spotw - boundary.width/2, spoth); // 15 |
---|
| 7531 | + spot.translate(32, 0); |
---|
| 7532 | + clickInfo.g.setColor(Color.yellow); |
---|
| 7533 | + clickInfo.g.fillRect(spot.x, spot.y, spot.width, spot.height); |
---|
| 7534 | + |
---|
| 7535 | + spot.translate(32, 64); |
---|
7391 | 7536 | spotw = spot.x + spot.width; |
---|
7392 | 7537 | spoth = spot.y + spot.height; |
---|
7393 | 7538 | clickInfo.g.setColor(Color.cyan); |
---|
.. | .. |
---|
7408 | 7553 | // { |
---|
7409 | 7554 | // CameraPane.Ymax = spoth; |
---|
7410 | 7555 | // } |
---|
7411 | | - // bonhommes info.g.drawLine(spotw, spoth, spotw, spoth - boundary.height/2); // 15 |
---|
7412 | | - //info.g.drawLine(spotw, spoth, spotw - boundary.width/2, spoth); // 15 |
---|
7413 | | - spot.translate(0, -32); |
---|
7414 | | - clickInfo.g.setColor(Color.yellow); |
---|
7415 | | - clickInfo.g.fillRect(spot.x, spot.y, spot.width, spot.height); |
---|
7416 | 7556 | clickInfo.g.setColor(Color.green); |
---|
7417 | | -// if (CameraPane.Xmin > spot.x) |
---|
7418 | | -// { |
---|
7419 | | -// CameraPane.Xmin = spot.x; |
---|
7420 | | -// } |
---|
7421 | | -// if (CameraPane.Xmax < spotw) |
---|
7422 | | -// { |
---|
7423 | | -// CameraPane.Xmax = spotw; |
---|
7424 | | -// } |
---|
7425 | | -// if (CameraPane.Ymin > spot.y) |
---|
7426 | | -// { |
---|
7427 | | -// CameraPane.Ymin = spot.y; |
---|
7428 | | -// } |
---|
7429 | | -// if (CameraPane.Ymax < spoth) |
---|
7430 | | -// { |
---|
7431 | | -// CameraPane.Ymax = spoth; |
---|
7432 | | -// } |
---|
7433 | 7557 | clickInfo.g.drawArc(boundary.x + clickInfo.DX, boundary.y + clickInfo.DY, |
---|
7434 | 7558 | (int)(boundary.width * clickInfo.W), (int)(boundary.height * clickInfo.W), 0, 360); |
---|
7435 | 7559 | //info.g.drawArc(spot.x, spotw, spot.width/2, boundary.height/2, 0, 360); |
---|
.. | .. |
---|
7488 | 7612 | retval = true; |
---|
7489 | 7613 | } |
---|
7490 | 7614 | spot.translate(0, 32); |
---|
| 7615 | + spot.translate(32, 0); |
---|
| 7616 | + spot.translate(0, 32); |
---|
7491 | 7617 | if (spot.contains(clickInfo.x, clickInfo.y)) |
---|
7492 | 7618 | { |
---|
7493 | 7619 | hitSomething = hitScale; |
---|
7494 | 7620 | |
---|
7495 | 7621 | double scale = 0.005f * clickInfo.camera.Distance(); |
---|
7496 | | - double hScale = (double) (clickInfo.x - centerPt.x) / 32; |
---|
| 7622 | + double hScale = (double) (clickInfo.x - centerPt.x) / 64; |
---|
7497 | 7623 | double sign = 1; |
---|
7498 | 7624 | if (hScale < 0) |
---|
7499 | 7625 | { |
---|
.. | .. |
---|
7505 | 7631 | //hScale = 0.01; |
---|
7506 | 7632 | } |
---|
7507 | 7633 | |
---|
7508 | | - double vScale = (double) (clickInfo.y - centerPt.y) / 32; |
---|
| 7634 | + double vScale = (double) (clickInfo.y - centerPt.y) / 64; |
---|
7509 | 7635 | sign = 1; |
---|
7510 | 7636 | if (vScale < 0) |
---|
7511 | 7637 | { |
---|
.. | .. |
---|
7585 | 7711 | |
---|
7586 | 7712 | scale *= 0.05f * Globals.theRenderer.RenderCamera().Distance(); |
---|
7587 | 7713 | |
---|
7588 | | - if (modified || opposite) |
---|
| 7714 | + // Modified could snap |
---|
| 7715 | + if (//modified || |
---|
| 7716 | + opposite) |
---|
7589 | 7717 | { |
---|
7590 | 7718 | //assert(false); |
---|
7591 | 7719 | /* |
---|
.. | .. |
---|
7679 | 7807 | |
---|
7680 | 7808 | if (modified) |
---|
7681 | 7809 | { |
---|
7682 | | - // Rotate 90 degrees |
---|
| 7810 | + // Rotate 45 degrees |
---|
7683 | 7811 | angle /= (Math.PI / 4); |
---|
7684 | 7812 | angle = Math.floor(angle + 0.5); |
---|
7685 | 7813 | angle *= (Math.PI / 4); |
---|
.. | .. |
---|
7720 | 7848 | break; |
---|
7721 | 7849 | |
---|
7722 | 7850 | case hitScale: // scale |
---|
7723 | | - double hScale = (double) (clickInfo.x - centerPt.x) / 32; |
---|
| 7851 | + double hScale = (double) (clickInfo.x - centerPt.x) / 64; |
---|
7724 | 7852 | double sign = 1; |
---|
7725 | 7853 | if (hScale < 0) |
---|
7726 | 7854 | { |
---|
.. | .. |
---|
7732 | 7860 | //hScale = 0.01; |
---|
7733 | 7861 | } |
---|
7734 | 7862 | |
---|
7735 | | - double vScale = (double) (clickInfo.y - centerPt.y) / 32; |
---|
| 7863 | + double vScale = (double) (clickInfo.y - centerPt.y) / 64; |
---|
7736 | 7864 | sign = 1; |
---|
7737 | 7865 | if (vScale < 0) |
---|
7738 | 7866 | { |
---|
.. | .. |
---|
7765 | 7893 | case 3: // '\001' |
---|
7766 | 7894 | if (modified || opposite) |
---|
7767 | 7895 | { |
---|
| 7896 | + if (modified) // && opposite) |
---|
| 7897 | + LA.matScale(toParent, totalScale, totalScale, totalScale); |
---|
| 7898 | + else |
---|
7768 | 7899 | //LA.matScale(toParent, 1, hScale, vScale); |
---|
7769 | | - LA.matScale(toParent, totalScale, 1, 1); |
---|
| 7900 | + LA.matScale(toParent, totalScale, 1, 1); |
---|
7770 | 7901 | } // vScale, 1); |
---|
7771 | 7902 | else |
---|
7772 | 7903 | { |
---|
7773 | 7904 | // EXCEPTION! |
---|
7774 | | - LA.matScale(toParent, totalScale, totalScale, totalScale); |
---|
| 7905 | + LA.matScale(toParent, 1, totalScale, totalScale); |
---|
7775 | 7906 | } // vScale, 1); |
---|
7776 | 7907 | break; |
---|
7777 | 7908 | |
---|
7778 | 7909 | case 2: // '\002' |
---|
7779 | 7910 | if (modified || opposite) |
---|
7780 | 7911 | { |
---|
7781 | | - //LA.matScale(toParent, hScale, 1, vScale); |
---|
7782 | | - LA.matScale(toParent, 1, totalScale, 1); |
---|
| 7912 | + if (modified) // && opposite) |
---|
| 7913 | + LA.matScale(toParent, totalScale, totalScale, totalScale); |
---|
| 7914 | + else |
---|
| 7915 | + //LA.matScale(toParent, hScale, 1, vScale); |
---|
| 7916 | + LA.matScale(toParent, 1, totalScale, 1); |
---|
7783 | 7917 | } else |
---|
7784 | 7918 | { |
---|
7785 | 7919 | LA.matScale(toParent, totalScale, 1, totalScale); |
---|
.. | .. |
---|
7789 | 7923 | case 1: // '\003' |
---|
7790 | 7924 | if (modified || opposite) |
---|
7791 | 7925 | { |
---|
7792 | | - //LA.matScale(toParent, hScale, vScale, 1); |
---|
7793 | | - LA.matScale(toParent, 1, 1, totalScale); |
---|
| 7926 | + if (modified) // && opposite) |
---|
| 7927 | + LA.matScale(toParent, totalScale, totalScale, totalScale); |
---|
| 7928 | + else |
---|
| 7929 | + //LA.matScale(toParent, hScale, vScale, 1); |
---|
| 7930 | + LA.matScale(toParent, 1, 1, totalScale); |
---|
7794 | 7931 | } else |
---|
7795 | 7932 | { |
---|
7796 | 7933 | LA.matScale(toParent, totalScale, totalScale, 1); |
---|