2 // TTEDIT.CPP - The TrueType Editor
4 // (C) 2004 Underground Software
6 // JLH = James L. Hammons <jlhamm@acm.org>
9 // --- ---------- -------------------------------------------------------------
10 // JLH 08/28/2008 Created this file
11 // JLH 09/02/2008 Separated scrolling from dedicated tool to MMB drag
12 // JLH 03/13/2009 Converted from wxWidgets to Qt
21 // - Fix bug in Glyphpoints when dragging on an empty canvas or loading a font
22 // - Fix zooming, settings (ini)
23 // - Fix point adding bug 1: should be able to add points to empty canvas
24 // - Fix point adding bug 2: should be able to add point successfully to single
26 // - Add poly multi-select
27 // - Add point multi-select
31 // Uncomment this for debugging...
33 #define DEBUGFOO // Various tool debugging...
34 #define DEBUGTP // Toolpalette debugging...
36 #include "editwindow.h"
37 #include "charwindow.h"
39 #include "graphicprimitives.h"
40 #include "mainwindow.h"
45 EditWindow::EditWindow(QWidget * parent/*= NULL*/): QWidget(parent),
46 scale(1.0), offsetX(-10), offsetY(-10), tool(TOOLSelect),
47 ptHighlight(-1), oldPtHighlight(-1), ptNextHighlight(-1), oldPtNextHighlight(-1),
48 polyFirstPoint(true), showRotationCenter(false), haveZeroPoint(false)
50 setBackgroundRole(QPalette::Base);
51 setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
53 toolPalette = new ToolWindow();
55 setCursor(cur[TOOLSelect]);
56 setMouseTracking(true);
60 QSize EditWindow::minimumSizeHint() const
66 QSize EditWindow::sizeHint() const
68 return QSize(400, 400);
72 void EditWindow::CreateCursors(void)
74 int hotx[9] = { 1, 1, 11, 15, 1, 1, 1, 1, 1 };
75 int hoty[9] = { 1, 1, 11, 13, 1, 1, 1, 1, 1 };
77 for(int i=0; i<9; i++)
80 s.sprintf(":/res/cursor%u.png", i+1);
82 cur[i] = QCursor(pmTmp, hotx[i], hoty[i]);
87 QPoint EditWindow::GetAdjustedMousePosition(QMouseEvent * event)
89 QSize winSize = size();
90 // This is undoing the transform, e.g. going from client coords to local coords.
91 // In essence, the height - y is height + (y * -1), the (y * -1) term doing the
92 // conversion of the y-axis from increasing bottom to top.
93 return QPoint(offsetX + event->x(), offsetY + (winSize.height() - event->y()));
97 QPoint EditWindow::GetAdjustedClientPosition(int x, int y)
99 QSize winSize = size();
101 // VOODOO ALERT (ON Y COMPONENT!!!!)
102 return QPoint(-offsetX + x, (winSize.height() - (-offsetY + y)) * +1.0);
108 o Different colors for polys on selected points
109 o Different colors for handles on non-selected polys
110 o Line of sight (dashed, dotted) for off-curve points
111 o Repaints for press/release of CTRL/SHIFT during point creation
113 void EditWindow::paintEvent(QPaintEvent * /*event*/)
116 //hm, causes lockup (or does it???)
117 p.setRenderHint(QPainter::Antialiasing);
119 //dc.SetBackground(*wxWHITE_BRUSH);
121 // Due to the screwiness of wxWidgets coord system, the origin is ALWAYS
122 // the upper left corner--regardless of axis orientation, etc...
123 // int width, height;
124 // dc.GetSize(&width, &height);
125 QSize winSize = size();
127 // dc.SetDeviceOrigin(-offsetX, height - (-offsetY));
128 // dc.SetAxisOrientation(true, true);
129 p.translate(QPoint(-offsetX, winSize.height() - (-offsetY)));
132 // Scrolling can be done by using OffsetViewportOrgEx
133 // Scaling can be done by adjusting SetWindowExtEx (it's denominator of txform)
134 // you'd use: % = ViewportExt / WindowExt
135 // But it makes the window look like crap: fuggetuboutit.
136 // Instead, we have to scale EVERYTHING by hand. Crap!
137 // It's not *that* bad, but not as convenient either...
139 // dc.SetPen(*(wxThePenList->FindOrCreatePen(wxColour(0x00, 0x00, 0xFF), 1, wxDOT)));
140 //// dc.DrawLine(0, 0, 10, 10);
141 p.setPen(QPen(Qt::blue, 1.0, Qt::DotLine));
143 // Draw coordinate axes
145 // dc.CrossHair(0, 0);
146 p.drawLine(0, -16384, 0, 16384);
147 p.drawLine(-16384, 0, 16384, 0);
149 // Draw rotation center (if active)
151 if (showRotationCenter)
153 p.setPen(QPen(Qt::red, 2.0, Qt::SolidLine));
154 p.drawLine(rotationCenter.x() + 7, rotationCenter.y(), rotationCenter.x() - 7, rotationCenter.y());
155 p.drawLine(rotationCenter.x(), rotationCenter.y() + 7, rotationCenter.x(), rotationCenter.y() - 7);
160 for(int i=0; i<pts.GetNumPoints(); i++)
162 if (i == ptHighlight)
164 // dc.SetPen(*(wxThePenList->FindOrCreatePen(wxColour(0xFF, 0x00, 0x00), 1, wxSOLID)));
165 //// SelectObject(hdc, hRedPen1);
166 p.setPen(QPen(Qt::red, 1.0, Qt::SolidLine));
168 if (pts.GetOnCurve(i))
170 DrawSquareDotN(p, pts.GetX(i), pts.GetY(i), 7);
171 DrawSquareDotN(p, pts.GetX(i), pts.GetY(i), 9);
175 DrawRoundDotN(p, pts.GetX(i), pts.GetY(i), 7);
176 DrawRoundDotN(p, pts.GetX(i), pts.GetY(i), 9);
179 else if ((i == ptHighlight || i == ptNextHighlight) && tool == TOOLAddPt)
181 // dc.SetPen(*(wxThePenList->FindOrCreatePen(wxColour(0x00, 0xAF, 0x00), 1, wxSOLID)));
182 //// SelectObject(hdc, hGreenPen1);
183 p.setPen(QPen(Qt::green, 1.0, Qt::SolidLine));
185 if (pts.GetOnCurve(i))
187 DrawSquareDotN(p, pts.GetX(i), pts.GetY(i), 7);
188 DrawSquareDotN(p, pts.GetX(i), pts.GetY(i), 9);
192 DrawRoundDotN(p, pts.GetX(i), pts.GetY(i), 7);
193 DrawRoundDotN(p, pts.GetX(i), pts.GetY(i), 9);
198 // dc.SetPen(*(wxThePenList->FindOrCreatePen(wxColour(0x00, 0x00, 0x00), 1, wxSOLID)));
199 //// SelectObject(hdc, hBlackPen1);
200 p.setPen(QPen(Qt::black, 1.0, Qt::SolidLine));
202 if (pts.GetOnCurve(i))
203 DrawSquareDot(p, pts.GetX(i), pts.GetY(i));
205 DrawRoundDot(p, pts.GetX(i), pts.GetY(i));
208 if (tool == TOOLDelPt && i == ptHighlight)
211 dc.SetPen(*(wxThePenList->FindOrCreatePen(wxColour(0xFF, 0x00, 0x00), 1, wxSOLID)));
212 // SelectObject(hdc, hRedPen1);
213 // MoveToEx(hdc, pts.GetX(i) - 5, pts.GetY(i) - 5, NULL);
214 // LineTo(hdc, pts.GetX(i) + 5, pts.GetY(i) + 5);
215 // LineTo(hdc, pts.GetX(i) - 5, pts.GetY(i) - 5);//Lameness!
216 // MoveToEx(hdc, pts.GetX(i) - 5, pts.GetY(i) + 5, NULL);
217 // LineTo(hdc, pts.GetX(i) + 5, pts.GetY(i) - 5);
218 // LineTo(hdc, pts.GetX(i) - 5, pts.GetY(i) + 5);//More lameness!!
220 p.setPen(QPen(Qt::red, 1.0, Qt::SolidLine));
221 p.drawLine(pts.GetX(i) - 5, pts.GetY(i) - 5, pts.GetX(i) + 5, pts.GetY(i) + 5);
222 p.drawLine(pts.GetX(i) + 5, pts.GetY(i) - 5, pts.GetX(i) - 5, pts.GetY(i) + 5);
226 //// SelectObject(hdc, hBlackPen1);
227 // dc.SetPen(*(wxThePenList->FindOrCreatePen(wxColour(0x00, 0x00, 0x00), 1, wxSOLID)));
228 p.setPen(QPen(Qt::black, 1.0, Qt::SolidLine));
230 // Draw curve formed by points
232 for(int poly=0; poly<pts.GetNumPolys(); poly++)
234 if (pts.GetNumPoints(poly) > 2)
237 // If it's not on curve, then move to it, otherwise move to last point...
241 if (pts.GetOnCurve(poly, pts.GetNumPoints(poly) - 1))
242 x = (int)pts.GetX(poly, pts.GetNumPoints(poly) - 1), y = (int)pts.GetY(poly, pts.GetNumPoints(poly) - 1);
244 x = (int)pts.GetX(poly, 0), y = (int)pts.GetY(poly, 0);
246 for(int i=0; i<pts.GetNumPoints(poly); i++)
248 if (pts.GetOnCurve(poly, i))
249 // LineTo(hdc, pts.GetX(poly, i), pts.GetY(poly, i));
251 p.drawLine(x, y, pts.GetX(poly, i), pts.GetY(poly, i));
252 x = (int)pts.GetX(poly, i), y = (int)pts.GetY(poly, i);
256 uint32 prev = pts.GetPrev(poly, i), next = pts.GetNext(poly, i);
257 float px = pts.GetX(poly, prev), py = pts.GetY(poly, prev),
258 nx = pts.GetX(poly, next), ny = pts.GetY(poly, next);
260 if (!pts.GetOnCurve(poly, prev))
261 px = (px + pts.GetX(poly, i)) / 2.0f,
262 py = (py + pts.GetY(poly, i)) / 2.0f;
264 if (!pts.GetOnCurve(poly, next))
265 nx = (nx + pts.GetX(poly, i)) / 2.0f,
266 ny = (ny + pts.GetY(poly, i)) / 2.0f;
268 Bezier(p, point(px, py), point(pts.GetX(poly, i), pts.GetY(poly, i)), point(nx, ny));
269 x = (int)nx, y = (int)ny;
271 if (pts.GetOnCurve(poly, next))
272 i++; // Following point is on curve, so move past it
281 GlyphPoints rotated = pts;
282 rotated.RotatePoints(rotationAngle, IPoint(rotationCenter.x(), rotationCenter.y()));
283 p.setPen(QPen(QColor(255, 0, 255), 1.0, Qt::SolidLine));
285 for(int poly=0; poly<rotated.GetNumPolys(); poly++)
287 if (rotated.GetNumPoints(poly) > 2)
290 // If it's not on curve, then move to it, otherwise move to last point...
294 if (rotated.GetOnCurve(poly, rotated.GetNumPoints(poly) - 1))
295 x = (int)rotated.GetX(poly, rotated.GetNumPoints(poly) - 1), y = (int)rotated.GetY(poly, rotated.GetNumPoints(poly) - 1);
297 x = (int)rotated.GetX(poly, 0), y = (int)rotated.GetY(poly, 0);
299 for(int i=0; i<rotated.GetNumPoints(poly); i++)
301 if (rotated.GetOnCurve(poly, i))
302 // LineTo(hdc, rotated.GetX(poly, i), rotated.GetY(poly, i));
304 p.drawLine(x, y, rotated.GetX(poly, i), rotated.GetY(poly, i));
305 x = (int)rotated.GetX(poly, i), y = (int)rotated.GetY(poly, i);
309 uint32 prev = rotated.GetPrev(poly, i), next = rotated.GetNext(poly, i);
310 float px = rotated.GetX(poly, prev), py = rotated.GetY(poly, prev),
311 nx = rotated.GetX(poly, next), ny = rotated.GetY(poly, next);
313 if (!rotated.GetOnCurve(poly, prev))
314 px = (px + rotated.GetX(poly, i)) / 2.0f,
315 py = (py + rotated.GetY(poly, i)) / 2.0f;
317 if (!rotated.GetOnCurve(poly, next))
318 nx = (nx + rotated.GetX(poly, i)) / 2.0f,
319 ny = (ny + rotated.GetY(poly, i)) / 2.0f;
321 Bezier(p, point(px, py), point(rotated.GetX(poly, i), rotated.GetY(poly, i)), point(nx, ny));
322 x = (int)nx, y = (int)ny;
324 if (rotated.GetOnCurve(poly, next))
325 i++; // Following point is on curve, so move past it
331 DrawGlyph(p, rotated);
337 void EditWindow::DrawGlyph(QPainter & p, GlyphPoints & glyph)
339 for(int poly=0; poly<glyph.GetNumPolys(); poly++)
341 if (glyph.GetNumPoints(poly) > 2)
344 // If it's not on curve, then move to it, otherwise move to last point...
348 if (glyph.GetOnCurve(poly, glyph.GetNumPoints(poly) - 1))
349 x = (int)glyph.GetX(poly, glyph.GetNumPoints(poly) - 1), y = (int)glyph.GetY(poly, glyph.GetNumPoints(poly) - 1);
351 x = (int)glyph.GetX(poly, 0), y = (int)glyph.GetY(poly, 0);
353 for(int i=0; i<glyph.GetNumPoints(poly); i++)
355 if (glyph.GetOnCurve(poly, i))
357 p.drawLine(x, y, glyph.GetX(poly, i), glyph.GetY(poly, i));
358 x = (int)glyph.GetX(poly, i), y = (int)glyph.GetY(poly, i);
362 uint32 prev = glyph.GetPrev(poly, i), next = glyph.GetNext(poly, i);
363 float px = glyph.GetX(poly, prev), py = glyph.GetY(poly, prev),
364 nx = glyph.GetX(poly, next), ny = glyph.GetY(poly, next);
366 if (!glyph.GetOnCurve(poly, prev))
367 px = (px + glyph.GetX(poly, i)) / 2.0f,
368 py = (py + glyph.GetY(poly, i)) / 2.0f;
370 if (!glyph.GetOnCurve(poly, next))
371 nx = (nx + glyph.GetX(poly, i)) / 2.0f,
372 ny = (ny + glyph.GetY(poly, i)) / 2.0f;
374 Bezier(p, point(px, py), point(glyph.GetX(poly, i), glyph.GetY(poly, i)), point(nx, ny));
375 x = (int)nx, y = (int)ny;
377 if (glyph.GetOnCurve(poly, next))
378 i++; // Following point is on curve, so move past it
386 void EditWindow::mousePressEvent(QMouseEvent * event)
388 if (event->button() == Qt::RightButton)
390 toolPalette->move(event->globalPos());
391 toolPalette->setVisible(true);
392 setCursor(cur[TOOLSelect]);
393 toolPalette->prevTool = TOOLSelect;
395 else if (event->button() == Qt::MidButton)
397 setCursor(cur[2]); // Scrolling cursor
399 else if (event->button() == Qt::LeftButton)
401 if (tool == TOOLScroll || tool == TOOLZoom)
402 ;//meh CaptureMouse(); // Make sure we capture the mouse when in scroll/zoom mode
403 else if (tool == TOOLAddPt) // "Add Point" tool
405 if (pts.GetNumPoints() > 0)
407 QPoint pt = GetAdjustedMousePosition(event);
408 pts.InsertPoint(pts.GetNext(ptHighlight), pt.x(), pt.y(), ((event->modifiers() == Qt::ShiftModifier || event->modifiers() == Qt::ControlModifier) ? false : true));
409 ptHighlight = ptNextHighlight;
413 else if (tool == TOOLAddPoly) // "Add Poly" tool
416 WriteLogMsg("Adding point... # polys: %u, # points: %u", pts.GetNumPolys(), pts.GetNumPoints());
420 polyFirstPoint = false;
421 pts.AddNewPolyAtEnd();
424 QPoint pt = GetAdjustedMousePosition(event);
425 //printf("GetAdjustedMousePosition = %i, %i\n", pt.x(), pt.y());
426 // Append a point to the end of the structure
427 pts += IPoint(pt.x(), pt.y(), ((event->modifiers() == Qt::ShiftModifier || event->modifiers() == Qt::ControlModifier) ? false : true));
428 ptHighlight = pts.GetNumPoints() - 1;
431 WriteLogMsg(" --> [# polys: %u, # points: %u]\n", pts.GetNumPolys(), pts.GetNumPoints());
434 else if (tool == TOOLSelect || tool == TOOLPolySelect)
436 if (pts.GetNumPoints() > 0)
438 pt = GetAdjustedClientPosition(pts.GetX(ptHighlight), pts.GetY(ptHighlight));
439 //printf("GetAdjustedClientPosition = %i, %i\n", pt.x(), pt.y());
440 // WarpPointer(pt.x, pt.y);
441 QCursor::setPos(mapToGlobal(pt));
443 if (event->modifiers() == Qt::ShiftModifier || event->modifiers() == Qt::ControlModifier)
445 pts.SetOnCurve(ptHighlight, !pts.GetOnCurve(ptHighlight));
450 else if (tool == TOOLDelPt)
452 if (pts.GetNumPoints() > 0)
454 // if (ptHighlight != -1)
456 //This assumes that WM_MOUSEMOVE happens before this!
457 //The above commented out line should take care of this contingency... !!! FIX !!!
458 pts.DeletePoint(ptHighlight);
462 else if (tool == TOOLRotate)
464 // I think what's needed here is to keep the initial mouse click,
465 // paint the rotation center, then use the 1st mouse move event to establish
466 // the rotation "zero line", which becomes the line of reference to all
467 // subsequent mouse moves.
468 rotationCenter = GetAdjustedMousePosition(event);
469 showRotationCenter = true;
470 haveZeroPoint = false;
480 void EditWindow::mouseMoveEvent(QMouseEvent * event)
482 if (event->buttons() == Qt::RightButton)
484 ToolType newTool = toolPalette->FindSelectedTool();
486 if (newTool != toolPalette->prevTool)
488 toolPalette->prevTool = newTool;
489 toolPalette->repaint();
492 else if (event->buttons() == Qt::MidButton)
494 // Calc offset from previous point
496 ptOffset = QPoint(pt.x() - ptPrevious.x(), pt.y() - ptPrevious.y());
498 // Then multiply it by the scaling factor. Whee!
499 // This looks wacky because we're using screen coords for the offset...
500 // Otherwise, we would subtract both offsets!
501 offsetX -= ptOffset.x(), offsetY += ptOffset.y();
505 else if (event->buttons() == Qt::LeftButton)
507 if (tool == TOOLAddPt || tool == TOOLAddPoly || tool == TOOLSelect)
509 if (tool != TOOLAddPt || pts.GetNumPoints() > 0)//yecch.
511 //temporary, for testing. BTW, Select drag bug is here...!
513 QPoint pt2 = GetAdjustedMousePosition(event);
514 pts.SetXY(ptHighlight, pt2.x(), pt2.y());
519 else if (tool == TOOLPolySelect)
521 if (pts.GetNumPoints() > 0)
523 QPoint pt2 = GetAdjustedMousePosition(event);
524 // Should also set onCurve here as well, depending on keystate
526 pts.OffsetPoly(pts.GetPoly(ptHighlight), pt2.x() - pts.GetX(ptHighlight), pt2.y() - pts.GetY(ptHighlight));
530 else if (tool == TOOLRotate)
532 if (pts.GetNumPoints() > 0)
536 rotationZeroPoint = GetAdjustedMousePosition(event);
537 haveZeroPoint = true;
541 // Figure out the angle between the "zero" vector and the current one,
542 // then rotate all points relative to the "zero" vector (done by paint())
543 QPoint currentPoint = GetAdjustedMousePosition(event);
544 Vector v1(rotationZeroPoint.x(), rotationZeroPoint.y(), 0,
545 rotationCenter.x(), rotationCenter.y(), 0);
546 Vector v2(currentPoint.x(), currentPoint.y(), 0,
547 rotationCenter.x(), rotationCenter.y(), 0);
548 // rotationAngle = v1.Angle(v2);
549 rotationAngle = v2.Angle(v1);
552 s.sprintf("%.3f degrees", rotationAngle * 180.0 / 3.14159265358979323);
553 ((TTEdit *)qApp)->mainWindow->statusBar()->showMessage(s);
560 else if (event->buttons() == Qt::NoButton)
562 // Moving, not dragging...
563 if (tool == TOOLSelect || tool == TOOLDelPt || tool == TOOLAddPt
564 || tool == TOOLPolySelect)// || tool == TOOLAddPoly)
566 QPoint pt2 = GetAdjustedMousePosition(event);
567 double closest = 1.0e+99;
569 for(int i=0; i<pts.GetNumPoints(); i++)
571 double dist = ((pt2.x() - pts.GetX(i)) * (pt2.x() - pts.GetX(i)))
572 + ((pt2.y() - pts.GetY(i)) * (pt2.y() - pts.GetY(i)));
575 closest = dist, ptHighlight = i;
578 if (ptHighlight != oldPtHighlight)
580 oldPtHighlight = ptHighlight;
584 // What follows here looks like voodoo, but is really simple. What we do is
585 // check to see if the mouse point has a perpendicular intersection with any of
586 // the line segments. If it does, calculate the length of the perpendicular
587 // and choose the smallest length. If there is no perpendicular, then choose the
588 // length of line connecting the closer of either the first endpoint or the
589 // second and choose the smallest of those.
591 // There is one bit of math that looks like voodoo to me ATM--will explain once
592 // I understand it better (the calculation of the length of the perpendicular).
594 if (pts.GetNumPoints() > 1 && tool == TOOLAddPt)
596 double smallest = 1.0e+99;
598 for(int i=0; i<pts.GetNumPoints(); i++)
600 int32 p1x = pts.GetX(i), p1y = pts.GetY(i),
601 p2x = pts.GetX(pts.GetNext(i)), p2y = pts.GetY(pts.GetNext(i));
603 Vector ls(p2x, p2y, 0, p1x, p1y, 0), v1(pt2.x(), pt2.y(), 0, p1x, p1y, 0),
604 v2(pt2.x(), pt2.y(), 0, p2x, p2y, 0);
605 double pp = ls.Dot(v1) / ls.Magnitude(), dist;
606 // Geometric interpretation:
607 // pp is the paremeterized point on the vector ls where the perpendicular intersects ls.
608 // If pp < 0, then the perpendicular lies beyond the 1st endpoint. If pp > length of ls,
609 // then the perpendicular lies beyond the 2nd endpoint.
612 dist = v1.Magnitude();
613 else if (pp > ls.Magnitude())
614 dist = v2.Magnitude();
615 else // distance = ?Det?(ls, v1) / |ls|
616 dist = fabs((ls.x * v1.y - v1.x * ls.y) / ls.Magnitude());
618 //The answer to the above looks like it might be found here:
620 //If the segment endpoints are s and e, and the point is p, then the test for the perpendicular
621 //intercepting the segment is equivalent to insisting that the two dot products {s-e}.{s-p} and
622 //{e-s}.{e-p} are both non-negative. Perpendicular distance from the point to the segment is
623 //computed by first computing the area of the triangle the three points form, then dividing by the
624 //length of the segment. Distances are done just by the Pythagorean theorem. Twice the area of the
625 //triangle formed by three points is the determinant of the following matrix:
631 //By translating the start point to the origin, this can be rewritten as:
632 //By subtracting row 1 from all rows, you get the following:
633 //[because sx = sy = 0. you could leave out the -sx/y terms below. because we subtracted
634 // row 1 from all rows (including row 1) row 1 turns out to be zero. duh!]
637 //(ex - sx) (ey - sy) 0
638 //(px - sx) (py - sy) 0
640 //which greatly simplifies the calculation of the determinant.
643 smallest = dist, ptNextHighlight = pts.GetNext(i), ptHighlight = i;
646 if (ptNextHighlight != oldPtNextHighlight)
648 oldPtNextHighlight = ptNextHighlight;
654 ptPrevious = event->pos();
661 void EditWindow::mouseReleaseEvent(QMouseEvent * event)
663 if (event->button() == Qt::RightButton)
665 ToolType newTool = toolPalette->FindSelectedTool();
667 // We only change the tool if a new one was actually selected. Otherwise, we do nothing.
668 if (newTool != TOOLNone)
672 if (tool == TOOLScroll || tool == TOOLZoom || tool == TOOLAddPoly
673 || tool == TOOLDelPoly)
676 if (tool == TOOLAddPoly)
677 polyFirstPoint = true;
680 toolPalette->setVisible(false);
681 setCursor(cur[tool]);
682 // Just in case we changed highlighting style with the new tool...
685 else if (event->button() == Qt::MidButton)
687 setCursor(cur[tool]); // Restore previous cursor
689 else if (event->button() == Qt::LeftButton)
691 if (showRotationCenter)
693 showRotationCenter = false;
694 haveZeroPoint = false;
695 pts.RotatePoints(rotationAngle, IPoint(rotationCenter.x(), rotationCenter.y()));
697 ((TTEdit *)qApp)->mainWindow->statusBar()->showMessage("");
700 // if (tool == TOOLScroll || tool == TOOLZoom)
702 //this is prolly too much
703 ((TTEdit *)qApp)->charWnd->MakePathFromPoints(&pts);
704 ((TTEdit *)qApp)->charWnd->update();