From 72dc09a25765788321847a8f0dcddad9575177a8 Mon Sep 17 00:00:00 2001 From: Maurice C Parker Date: Tue, 25 Aug 2020 17:34:13 -0500 Subject: [PATCH] Position the image assets on pixel boundaries. Issue #2350 --- Mac/MainWindow/ArticleExtractorButton.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Mac/MainWindow/ArticleExtractorButton.swift b/Mac/MainWindow/ArticleExtractorButton.swift index 718291fe1..58f4f4098 100644 --- a/Mac/MainWindow/ArticleExtractorButton.swift +++ b/Mac/MainWindow/ArticleExtractorButton.swift @@ -74,7 +74,7 @@ class ArticleExtractorButton: NSButton { private func makeLayerForImage(_ image: NSImage) -> CALayer { let imageLayer = CALayer() imageLayer.bounds = CGRect(x: 0, y: 0, width: image.size.width, height: image.size.height) - imageLayer.position = CGPoint(x: bounds.midX, y: bounds.midY) + imageLayer.position = CGPoint(x: bounds.midX, y: floor(bounds.midY)) return imageLayer } @@ -94,7 +94,7 @@ class ArticleExtractorButton: NSButton { let imageLayer = CALayer() imageLayer.bounds = CGRect(x: 0, y: 0, width: imageProgress1?.size.width ?? 0, height: imageProgress1?.size.height ?? 0) - imageLayer.position = CGPoint(x: bounds.midX, y: bounds.midY) + imageLayer.position = CGPoint(x: bounds.midX, y: floor(bounds.midY)) hostedLayer.addSublayer(imageLayer)