Skip to content

Commit

Permalink
Bump tiny-skia to v0.11 (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
notgull authored Aug 4, 2023
1 parent cb4d79a commit f8ca6fa
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ description = "Adwaita-like SCTK Frame"

[dependencies]
smithay-client-toolkit = { version = "0.17.0", default_features = false }
tiny-skia = { version = "0.8", default-features = false, features = ["std", "simd"] }
tiny-skia = { version = "0.11", default-features = false, features = ["std", "simd"] }
log = "0.4"
memmap2 = { version = "0.5.8", optional = true }

Expand Down
4 changes: 3 additions & 1 deletion src/buttons.rs
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,9 @@ impl Button {

let x = x - hsize;
let y = y - hsize;
pb.push_rect(x, y, size, size);
if let Some(rect) = Rect::from_xywh(x, y, size, size) {
pb.push_rect(rect);
}

if state.contains(WindowState::MAXIMIZED) {
if let Some(rect) =
Expand Down
10 changes: 5 additions & 5 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::num::NonZeroU32;
use std::sync::Arc;

use tiny_skia::{
ClipMask, Color, FillRule, Path, PathBuilder, Pixmap, PixmapMut, PixmapPaint, Point, Rect,
Color, FillRule, Mask, Path, PathBuilder, Pixmap, PixmapMut, PixmapPaint, Point, Rect,
Transform,
};

Expand Down Expand Up @@ -535,13 +535,13 @@ fn draw_headerbar(
if let Some(clip) =
Rect::from_xywh(text_canvas_start_x, 0., text_canvas_end_x, canvas_h)
{
let mut mask = ClipMask::new();
mask.set_path(
canvas_w as u32,
canvas_h as u32,
let mut mask = Mask::new(canvas_w as u32, canvas_h as u32)
.expect("Invalid mask width and height");
mask.fill_path(
&PathBuilder::from_rect(clip),
FillRule::Winding,
false,
Transform::identity(),
);
pixmap.draw_pixmap(
x as i32,
Expand Down

0 comments on commit f8ca6fa

Please sign in to comment.