From 76090f6d36360a4f1eb15d55d1683bbb207c6bcf Mon Sep 17 00:00:00 2001 From: David Vierra Date: Sun, 31 Jan 2016 20:02:48 -1000 Subject: [PATCH] BrushCommand uses UnionBox instead of reduce to combine selections --- src/mcedit2/editortools/brush/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mcedit2/editortools/brush/__init__.py b/src/mcedit2/editortools/brush/__init__.py index 62dca1a..664630e 100644 --- a/src/mcedit2/editortools/brush/__init__.py +++ b/src/mcedit2/editortools/brush/__init__.py @@ -22,6 +22,7 @@ from mcedit2.util import bresenham from mcedit2.util.showprogress import showProgress from mcedit2.util.worldloader import WorldLoader from mceditlib.geometry import Vector +from mceditlib.selection import UnionBox from mceditlib.util import exhaust log = logging.getLogger(__name__) @@ -69,12 +70,11 @@ class BrushCommand(SimplePerformCommand): exhaust(self._perform()) def _perform(self): - yield 0, len(self.points), "Applying {0} brush...".format(self.brushMode.name) try: selections = [self.brushShape.createShapedSelection(self.brushMode.brushBoxForPoint(point, self.options), self.editorSession.currentDimension) for point in self.points] - selection = reduce(lambda a, b: a | b, selections) + selection = UnionBox(*selections) for i in self.brushMode.applyToSelection(self, selection): yield i except NotImplementedError: