summaryrefslogtreecommitdiff
path: root/gerber/render/cairo_backend.py
diff options
context:
space:
mode:
Diffstat (limited to 'gerber/render/cairo_backend.py')
-rw-r--r--gerber/render/cairo_backend.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/gerber/render/cairo_backend.py b/gerber/render/cairo_backend.py
index 7063808..a3ee3fa 100644
--- a/gerber/render/cairo_backend.py
+++ b/gerber/render/cairo_backend.py
@@ -13,12 +13,13 @@
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
-# limitations under the License.
+# limitations under the License.
try:
import cairo
except ImportError:
- import cairocffi as cairo
+ import cairocffi as cairo
+
from operator import mul, div
import math
import tempfile
@@ -47,7 +48,7 @@ class GerberCairoContext(GerberContext):
def set_bounds(self, bounds, new_surface=False):
origin_in_inch = (bounds[0][0], bounds[1][0])
size_in_inch = (abs(bounds[0][1] - bounds[0][0]), abs(bounds[1][1] - bounds[1][0]))
- size_in_pixels = map(mul, size_in_inch, self.scale)
+ size_in_pixels = tuple(map(mul, size_in_inch, self.scale))
self.origin_in_inch = origin_in_inch if self.origin_in_inch is None else self.origin_in_inch
self.size_in_inch = size_in_inch if self.size_in_inch is None else self.size_in_inch
if (self.surface is None) or new_surface: