Initial patch to unify our render towards cairo
This branch allows a pure cairo based render for both PNG and SVG. Cairo backend is mostly the same but with improved support for configurable scale, orientation and inverted color drawing. API is not yet final.
This commit is contained in:
parent
9e36d7e21d
commit
5aaf18889c
3 changed files with 63 additions and 40 deletions
|
|
@ -62,6 +62,7 @@ class GerberContext(object):
|
|||
self._drill_color = (0.25, 0.25, 0.25)
|
||||
self._background_color = (0.0, 0.0, 0.0)
|
||||
self._alpha = 1.0
|
||||
self._invert = False
|
||||
|
||||
@property
|
||||
def units(self):
|
||||
|
|
@ -122,6 +123,14 @@ class GerberContext(object):
|
|||
raise ValueError('Alpha must be between 0.0 and 1.0')
|
||||
self._alpha = alpha
|
||||
|
||||
@property
|
||||
def invert(self):
|
||||
return self._invert
|
||||
|
||||
@invert.setter
|
||||
def invert(self, invert):
|
||||
self._invert = invert
|
||||
|
||||
def render(self, primitive):
|
||||
color = (self.color if primitive.level_polarity == 'dark'
|
||||
else self.background_color)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue