Manually merge change 5430fa6738
This commit is contained in:
commit
e8327fda79
1 changed files with 4 additions and 3 deletions
|
|
@ -13,12 +13,13 @@
|
||||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import cairo
|
import cairo
|
||||||
except ImportError:
|
except ImportError:
|
||||||
import cairocffi as cairo
|
import cairocffi as cairo
|
||||||
|
|
||||||
from operator import mul, div
|
from operator import mul, div
|
||||||
import math
|
import math
|
||||||
import tempfile
|
import tempfile
|
||||||
|
|
@ -47,7 +48,7 @@ class GerberCairoContext(GerberContext):
|
||||||
def set_bounds(self, bounds, new_surface=False):
|
def set_bounds(self, bounds, new_surface=False):
|
||||||
origin_in_inch = (bounds[0][0], bounds[1][0])
|
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_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.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
|
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:
|
if (self.surface is None) or new_surface:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue