mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-26 03:59:55 +00:00
Round clip bounds to whole pixels
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
parent
d853dbb048
commit
385d15cd0c
1 changed files with 3 additions and 2 deletions
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue