Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump tiny-skia to v0.11 #32

Merged
merged 1 commit into from
Aug 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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