mirror of
https://github.com/Ranchero-Software/NetNewsWire.git
synced 2025-01-24 16:10:41 +01:00
Position the image assets on pixel boundaries. Issue #2350
This commit is contained in:
parent
8350586dc3
commit
72dc09a257
@ -74,7 +74,7 @@ class ArticleExtractorButton: NSButton {
|
|||||||
private func makeLayerForImage(_ image: NSImage) -> CALayer {
|
private func makeLayerForImage(_ image: NSImage) -> CALayer {
|
||||||
let imageLayer = CALayer()
|
let imageLayer = CALayer()
|
||||||
imageLayer.bounds = CGRect(x: 0, y: 0, width: image.size.width, height: image.size.height)
|
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
|
return imageLayer
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -94,7 +94,7 @@ class ArticleExtractorButton: NSButton {
|
|||||||
|
|
||||||
let imageLayer = CALayer()
|
let imageLayer = CALayer()
|
||||||
imageLayer.bounds = CGRect(x: 0, y: 0, width: imageProgress1?.size.width ?? 0, height: imageProgress1?.size.height ?? 0)
|
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)
|
hostedLayer.addSublayer(imageLayer)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user