booleanOperations library: remove unreachable break and add exception instead of assertion, as done in upstream
This commit is contained in:
parent
632609fc65
commit
0d7d370104
2 changed files with 7 additions and 2 deletions
|
|
@ -19,3 +19,7 @@ class InvalidClippingContourError(InvalidContourError):
|
|||
|
||||
class ExecutionError(BooleanOperationsError):
|
||||
"""Raised when clipping execution fails"""
|
||||
|
||||
|
||||
class OpenContourError(BooleanOperationsError):
|
||||
"""Raised when any input contour is open"""
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ import math
|
|||
from fontTools.misc import bezierTools
|
||||
from fontTools.pens.basePen import decomposeQuadraticSegment
|
||||
import pyclipper
|
||||
from .exceptions import OpenContourError
|
||||
|
||||
"""
|
||||
To Do:
|
||||
|
|
@ -343,7 +344,8 @@ class ContourPointDataPen:
|
|||
pass
|
||||
|
||||
def addPoint(self, pt, segmentType=None, smooth=False, name=None, **kwargs):
|
||||
assert segmentType != "move"
|
||||
if segmentType == "move":
|
||||
raise OpenContourError("Unhandled open contour")
|
||||
if not self._foundStartingPoint and segmentType is not None:
|
||||
kwargs['startingPoint'] = self._foundStartingPoint = True
|
||||
data = InputPoint(
|
||||
|
|
@ -373,7 +375,6 @@ def _prepPointsForSegments(points):
|
|||
point = points.pop()
|
||||
points.insert(0, point)
|
||||
continue
|
||||
break
|
||||
|
||||
|
||||
def _copyPoints(points):
|
||||
|
|
|
|||
Reference in a new issue