Update to Kurbo 0.11.1 (#671)

This allows to remove a TODO comment.
This commit is contained in:
Marco Melorio 2024-10-14 18:27:40 +02:00 committed by GitHub
parent 4ad4506bc0
commit d74a7deea1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 7 additions and 17 deletions

8
Cargo.lock generated
View File

@ -209,9 +209,9 @@ checksum = "9d151e35f61089500b617991b791fc8bfd237ae50cd5950803758a179b41e67a"
[[package]]
name = "arrayvec"
version = "0.7.4"
version = "0.7.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711"
checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50"
[[package]]
name = "as-raw-xcb-connection"
@ -1905,9 +1905,9 @@ checksum = "e2db585e1d738fc771bf08a151420d3ed193d9d895a36df7f6f8a9456b911ddc"
[[package]]
name = "kurbo"
version = "0.11.0"
version = "0.11.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6e5aa9f0f96a938266bdb12928a67169e8d22c6a786fda8ed984b85e6ba93c3c"
checksum = "89234b2cc610a7dd927ebde6b41dd1a5d4214cffaef4cf1fb2195d592f92518f"
dependencies = [
"arrayvec",
"smallvec",

View File

@ -106,7 +106,7 @@ masonry = { version = "0.2.0", path = "masonry" }
xilem_core = { version = "0.1.0", path = "xilem_core" }
vello = "0.2.1"
wgpu = "0.20.1"
kurbo = "0.11.0"
kurbo = "0.11.1"
parley = "0.1.0"
peniko = "0.1.1"
winit = "0.30.4"

View File

@ -15,16 +15,6 @@ use crate::tree_arena::ArenaRefChildren;
use crate::widget::WidgetState;
use crate::{BoxConstraints, LayoutCtx, Widget, WidgetPod};
// TODO - Replace with contains_rect once new Kurbo version is released.
// See https://github.com/linebender/kurbo/pull/347
/// Return `true` if all of `smaller` is within `larger`.
fn rect_contains(larger: &Rect, smaller: &Rect) -> bool {
smaller.x0 >= larger.x0
&& smaller.x1 <= larger.x1
&& smaller.y0 >= larger.y0
&& smaller.y1 <= larger.y1
}
// --- MARK: CHECKS ---
// TODO - document
// TODO - This method should take a 'can_skip: Fn(WidgetRef) -> bool'
@ -234,7 +224,7 @@ pub(crate) fn run_layout_inner<W: Widget>(
// TODO - This check might be redundant with the code updating local_paint_rect
let child_rect = child_state.paint_rect();
if !rect_contains(&state.local_paint_rect, &child_rect) && state.clip.is_none() {
if !state.local_paint_rect.contains_rect(child_rect) && state.clip.is_none() {
debug_panic!(
"Error in '{}' {}: paint_rect {:?} doesn't contain paint_rect {:?} of child widget '{}' {}",
widget.short_type_name(),

View File

@ -88,7 +88,7 @@ impl Widget for Image {
// in the size exactly. If it is unconstrained by both width and height take the size of
// the image.
let image_size = Size::new(self.image_data.width as f64, self.image_data.height as f64);
if image_size.is_empty() {
if image_size.is_zero_area() {
let size = bc.min();
return size;
}