diff options
author | Garret Fick <garret@ficksworkshop.com> | 2016-07-20 23:26:51 +0800 |
---|---|---|
committer | Garret Fick <garret@ficksworkshop.com> | 2016-07-20 23:26:51 +0800 |
commit | e8327fda79ede786e2fbc79eaf1b394f12fe66ce (patch) | |
tree | edf9cead9ff083a362f7c4ab2ace80e5c6e19a64 /gerber/render | |
parent | 76a49ec8e7d286f887603d05ee64b78e50ca3112 (diff) | |
parent | 5430fa6738b74f324c47c947477dd5b779db5d1c (diff) | |
download | gerbonara-e8327fda79ede786e2fbc79eaf1b394f12fe66ce.tar.gz gerbonara-e8327fda79ede786e2fbc79eaf1b394f12fe66ce.tar.bz2 gerbonara-e8327fda79ede786e2fbc79eaf1b394f12fe66ce.zip |
Manually merge change 5430fa6738b74f324c47c947477dd5b779db5d1c
Diffstat (limited to 'gerber/render')
-rw-r--r-- | gerber/render/cairo_backend.py | 7 |
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:
|