mirror of
https://github.com/zed-industries/zed.git
synced 2025-02-04 10:12:47 +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,
|
drawable_size: Vector2F,
|
||||||
command_encoder: &metal::RenderCommandEncoderRef,
|
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.),
|
vec2f(0., 0.),
|
||||||
drawable_size / scene.scale_factor(),
|
drawable_size / scene.scale_factor(),
|
||||||
)) * scene.scale_factor();
|
)) * scene.scale_factor())
|
||||||
|
.round();
|
||||||
command_encoder.set_scissor_rect(metal::MTLScissorRect {
|
command_encoder.set_scissor_rect(metal::MTLScissorRect {
|
||||||
x: clip_bounds.origin_x() as NSUInteger,
|
x: clip_bounds.origin_x() as NSUInteger,
|
||||||
y: clip_bounds.origin_y() as NSUInteger,
|
y: clip_bounds.origin_y() as NSUInteger,
|
||||||
|
|
Loading…
Reference in a new issue