From 385d15cd0cad132a97dd54aedb5317d90a7c8a10 Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Wed, 31 Mar 2021 16:23:37 +0200 Subject: [PATCH] Round clip bounds to whole pixels Co-Authored-By: Nathan Sobo --- gpui/src/platform/mac/renderer.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gpui/src/platform/mac/renderer.rs b/gpui/src/platform/mac/renderer.rs index 61680dfb90..11ca3915fb 100644 --- a/gpui/src/platform/mac/renderer.rs +++ b/gpui/src/platform/mac/renderer.rs @@ -310,10 +310,11 @@ impl Renderer { drawable_size: Vector2F, command_encoder: &metal::RenderCommandEncoderRef, ) { - let clip_bounds = layer.clip_bounds().unwrap_or(RectF::new( + let clip_bounds = (layer.clip_bounds().unwrap_or(RectF::new( vec2f(0., 0.), drawable_size / scene.scale_factor(), - )) * scene.scale_factor(); + )) * scene.scale_factor()) + .round(); command_encoder.set_scissor_rect(metal::MTLScissorRect { x: clip_bounds.origin_x() as NSUInteger, y: clip_bounds.origin_y() as NSUInteger,