From 4f702125509d9073f5a61a9b6e7d720b37ec178f Mon Sep 17 00:00:00 2001 From: Tim Fritzen Date: Tue, 29 Aug 2023 15:32:19 +0200 Subject: [PATCH 1/2] Crashing with `Invalid ScissorRect Parameters` Fixes #77 Defaults to framebuffer size when to big. --- src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 63cd19a..83ebf95 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -730,8 +730,8 @@ impl Renderer { let scissors = ( clip_rect[0].max(0.0).floor() as u32, clip_rect[1].max(0.0).floor() as u32, - (clip_rect[2] - clip_rect[0]).abs().ceil() as u32, - (clip_rect[3] - clip_rect[1]).abs().ceil() as u32, + (clip_rect[2].min(fb_size[0]) - clip_rect[0]).abs().ceil() as u32, + (clip_rect[3].min(fb_size[1]) - clip_rect[1]).abs().ceil() as u32, ); // XXX: Work-around for wgpu issue [1] by only issuing draw From 2ac495f0b73077aaf7cdd33dd11474c40942ee7d Mon Sep 17 00:00:00 2001 From: Tim Fritzen Date: Tue, 29 Aug 2023 15:38:38 +0200 Subject: [PATCH 2/2] Ran cargo doc and cargo clippy and added CHANGELOG --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7de95d0..aa37f2f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -36,6 +36,8 @@ Per Keep a Changelog there are 6 main categories of changes: ## Unreleased +- Internal: Fixed Scissor-Rect to not span across Framebuffersize, by limiting to framebuffer width. @PixelboysTM + ## v0.24.0 Released 2023-08-02