support alpha for tile background color
This commit is contained in:
parent
5c176bc7bb
commit
300d85e5ed
2 changed files with 2 additions and 2 deletions
|
@ -50,7 +50,7 @@ class RenderEngine(ABC):
|
||||||
self.buffered_height = self.height + 2 * self.buffer
|
self.buffered_height = self.height + 2 * self.buffer
|
||||||
self.buffered_bbox = self.bbox.buffer(buffer, join_style=JOIN_STYLE.mitre)
|
self.buffered_bbox = self.bbox.buffer(buffer, join_style=JOIN_STYLE.mitre)
|
||||||
|
|
||||||
self.background_rgb = tuple(int(background[i:i + 2], 16)/255 for i in range(1, 6, 2))
|
self.background_rgb = tuple(int(background[i:i + 2], 16)/255 for i in range(1, len(background), 2))
|
||||||
|
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
def render(self, filename=None) -> bytes:
|
def render(self, filename=None) -> bytes:
|
||||||
|
|
|
@ -121,7 +121,7 @@ class SVGEngine(RenderEngine):
|
||||||
svg.render_cairo(buffered_context)
|
svg.render_cairo(buffered_context)
|
||||||
|
|
||||||
# create cropped image
|
# create cropped image
|
||||||
surface = buffered_surface.create_similar(cairo.CONTENT_COLOR, self.width, self.height)
|
surface = buffered_surface.create_similar(cairo.CONTENT_COLOR_ALPHA, self.width, self.height)
|
||||||
context = cairo.Context(surface)
|
context = cairo.Context(surface)
|
||||||
|
|
||||||
# set background color
|
# set background color
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue