def mouseDown(self, point, clickCount):
     if not (self.shiftDown):
         self.selection.resetSelection()
     if clickCount > 1:
         self._newAnchor(point)
     else:
         self.pStart = point
         self.pEnd = None
         s = self._view.getGlyphViewOnCurvePointsSize(minSize=7)
         for contour in self._glyph:
             for p in contour.onCurvePoints:
                 if bezierTools.distanceFromPointToPoint(p, point) < s:
                     self.selection.addPoint(p,
                                             self.shiftDown,
                                             contour=contour)
                     self._selectedMouseDownPoint = (p.x, p.y)
                     return
         for anchor in self._glyph.anchors:
             if bezierTools.distanceFromPointToPoint(anchor, point) < s:
                 self.selection.addAnchor(anchor, self.shiftDown)
                 self._selectedMouseDownPoint = (anchor.x, anchor.y)
                 return
 def findObjectInGlyphForPoint(self, glyph, point):
     found = None
     if self.drawingMode == COMPONENT_MODE:
         size = self.size
         halfSize = size * .5
         for component in glyph.components:
             x, y = component.offset
             if bezierTools.distanceFromPointToPoint((x+halfSize, y+halfSize), point) < size:
                 found = component
                 break
     else:
         for contour in glyph:
             if contour.pointInside(point):
                 found = contour
                 break
     return found
Exemple #3
0
 def mouseDown(self, point, clickCount):
     if not(self.shiftDown):
         self.errorSelection.resetSelection()
     if clickCount > 1:
         #self._newAnchor(point)
         pass
     else:
         self.pStart = point
         self.pEnd = None
         s = self._view.getGlyphViewOnCurvePointsSize(minSize=7)
         for error in self.ui.errors:
             p = error.position
             if bezierTools.distanceFromPointToPoint(p, point) < s:
                 self.errorSelection.addError(p, self.shiftDown)
                 self._selectedMouseDownPoint = p
                 break
 def mouseDown(self, point, clickCount):
     if not (self.shiftDown):
         self.errorSelection.resetSelection()
     if clickCount > 1:
         #self._newAnchor(point)
         pass
     else:
         self.pStart = point
         self.pEnd = None
         s = self._view.getGlyphViewOnCurvePointsSize(minSize=7)
         for error in self.ui.errors:
             p = error.position
             if bezierTools.distanceFromPointToPoint(p, point) < s:
                 self.errorSelection.addError(p, self.shiftDown)
                 self._selectedMouseDownPoint = p
                 break