Skip to content

Commit

Permalink
Release 0.10.1 with fix for accidental scissor clip breakage
Browse files Browse the repository at this point in the history
Commit 7c5ad1f accidentially introduced `x` and `y` variables that shadowed the `x` and `y` parameters.
  • Loading branch information
tronical committed Oct 24, 2024
1 parent 4497b97 commit 088fc4f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file.

## Unreleased

## [0.10.1] - 2024-10-24

- Fix accidental breakage with scissor clipping.

## [0.10.0] - 2024-10-23

- **breaking**: Removed the mutable reference of self in `new` constructor for Transform2D
Expand Down Expand Up @@ -202,3 +206,6 @@ All notable changes to this project will be documented in this file.
[0.8.2]: https://github.com/femtovg/femtovg/releases/tag/v0.8.2
[0.9.0]: https://github.com/femtovg/femtovg/releases/tag/v0.9.0
[0.9.1]: https://github.com/femtovg/femtovg/releases/tag/v0.9.1
[0.9.2]: https://github.com/femtovg/femtovg/releases/tag/v0.9.2
[0.10.0]: https://github.com/femtovg/femtovg/releases/tag/v0.10.0
[0.10.1]: https://github.com/femtovg/femtovg/releases/tag/v0.10.1
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "femtovg"
description = "Antialiased 2D vector drawing library"
version = "0.10.0"
version = "0.10.1"
license = "MIT/Apache-2.0"
readme = "README.md"
authors = [
Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -765,15 +765,15 @@ where
// Transform the current scissor rect into current transform space.
// If there is difference in rotation, this will be approximation.

let Transform2D([a, b, c, d, x, y]) = state.scissor.transform / state.transform;
let Transform2D([a, b, c, d, tx, ty]) = state.scissor.transform / state.transform;

let ex = extent[0];
let ey = extent[1];

let tex = ex * a.abs() + ey * c.abs();
let tey = ex * b.abs() + ey * d.abs();

let rect = Rect::new(x - tex, y - tey, tex * 2.0, tey * 2.0);
let rect = Rect::new(tx - tex, ty - tey, tex * 2.0, tey * 2.0);
let res = rect.intersect(Rect::new(x, y, w, h));

self.scissor(res.x, res.y, res.w, res.h);
Expand Down

0 comments on commit 088fc4f

Please sign in to comment.