From 4407acf750f950854524b56829810412b3818c25 Mon Sep 17 00:00:00 2001 From: SusanDoggie Date: Thu, 4 Apr 2019 15:53:35 +0800 Subject: [PATCH] clean --- Sources/Doggie/PDFContext/PDFContextImage.swift | 5 +++-- Sources/Doggie/SVGContext/SVGContext.swift | 3 +++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Sources/Doggie/PDFContext/PDFContextImage.swift b/Sources/Doggie/PDFContext/PDFContextImage.swift index f9c5576f2..b3c290b6d 100644 --- a/Sources/Doggie/PDFContext/PDFContextImage.swift +++ b/Sources/Doggie/PDFContext/PDFContextImage.swift @@ -37,6 +37,9 @@ extension PDFContext.Page { func _draw(image: AnyImage, transform: SDTransform, compression: PDFContext.CompressionScheme) { + self.beginTransparencyLayer() + defer { self.endTransparencyLayer() } + let key = image.imageTableKey let name: String @@ -92,10 +95,8 @@ extension PDFContext.Page { "\(_decimal_round(transform.f))", ] - current_layer.commands += "q\n" current_layer.commands += "\(_transform.joined(separator: " ")) cm\n" current_layer.commands += "/\(name) Do\n" - current_layer.commands += "Q\n" } } diff --git a/Sources/Doggie/SVGContext/SVGContext.swift b/Sources/Doggie/SVGContext/SVGContext.swift index 4e4e73693..c190be73e 100644 --- a/Sources/Doggie/SVGContext/SVGContext.swift +++ b/Sources/Doggie/SVGContext/SVGContext.swift @@ -636,6 +636,9 @@ extension SVGContext { private func _draw(image: SVGImageProtocol, transform: SDTransform, using storageType: ImageRep.MediaType, properties: [ImageRep.PropertyKey : Any]) { + self.beginTransparencyLayer() + defer { self.endTransparencyLayer() } + let key = image.imageTableKey let id: String