Skip to content

Commit e4076c6

Browse files
committed
[cargo] bump deps
1 parent bb4f83f commit e4076c6

File tree

6 files changed

+19
-34
lines changed

6 files changed

+19
-34
lines changed

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "rasterize"
3-
version = "0.6.7"
3+
version = "0.6.8"
44
authors = ["Pavel Aslanov <asl.pavel@gmail.com>"]
55
description = "Simple and small 2D rendering library"
66
edition = "2024"
@@ -28,12 +28,12 @@ serde = ["dep:serde", "dep:serde_json"]
2828
tracing = "^0.1"
2929
serde = { version = "1.0", features = ["rc", "derive"], optional = true }
3030
serde_json = { version = "1.0", features = ["preserve_order"], optional = true }
31-
png = { version = "^0.17", optional = true }
31+
png = { version = "^0.18", optional = true }
3232
bytemuck = { version = "1.21", features = ["derive"] }
3333
lexical-core = { version = "^1.0", default-features = false, features = [ "write-floats", "format" ] }
3434

3535
[dev-dependencies]
36-
criterion = { version = "^0.6", features = ["html_reports"] }
36+
criterion = { version = "^0.7", features = ["html_reports"] }
3737
tracing-subscriber = { version = "^0.3", features = ["env-filter"] }
3838

3939
[[bench]]

src/curve.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1393,15 +1393,15 @@ fn cubic_offset_rec(
13931393
let result: Segment = Cubic(points).into();
13941394
// there could a disconnect between offset curves.
13951395
// For example M0,0 C10,5 0,5 10,0.
1396-
if let Some(last) = last {
1397-
if !last.end().is_close_to(result.start()) {
1398-
let stroke_style = StrokeStyle {
1399-
width: dist * 2.0,
1400-
line_join: LineJoin::Round,
1401-
line_cap: LineCap::Round,
1402-
};
1403-
out.extend(last.line_join(result, stroke_style));
1404-
}
1396+
if let Some(last) = last
1397+
&& !last.end().is_close_to(result.start())
1398+
{
1399+
let stroke_style = StrokeStyle {
1400+
width: dist * 2.0,
1401+
line_join: LineJoin::Round,
1402+
line_cap: LineCap::Round,
1403+
};
1404+
out.extend(last.line_join(result, stroke_style));
14051405
}
14061406
out.extend(Some(result));
14071407
Some(result)

src/geometry.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ pub const PI: f64 = std::f64::consts::PI;
2020
const SCALAR_PRECISION: usize = 4;
2121
const SCALAR_FORMAT: u128 = lexical_core::NumberFormatBuilder::new()
2222
.required_integer_digits(false)
23-
.build();
23+
.build_strict();
2424
const SCALAR_FORMAT_OPTIONS: lexical_core::WriteFloatOptions =
2525
lexical_core::WriteFloatOptions::builder()
2626
.max_significant_digits(std::num::NonZero::new(SCALAR_PRECISION))

src/grad.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,15 @@ use serde::{Deserialize, Serialize, de};
44
use std::cmp::Ordering;
55

66
/// Gradient spread logic for the parameter smaller than 0 and greater than 1
7-
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
7+
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default)]
88
#[cfg_attr(
99
feature = "serde",
1010
derive(Serialize, Deserialize),
1111
serde(rename_all = "lowercase")
1212
)]
1313
pub enum GradSpread {
1414
/// Use the same colors as the edge of the gradient
15+
#[default]
1516
Pad,
1617
/// Repeat gradient
1718
Repeat,
@@ -30,12 +31,6 @@ impl GradSpread {
3031
}
3132
}
3233

33-
impl Default for GradSpread {
34-
fn default() -> Self {
35-
Self::Pad
36-
}
37-
}
38-
3934
/// Specifies color at a particular parameter offset of the gradient
4035
#[derive(Debug, Clone, Copy, PartialEq)]
4136
pub struct GradStop {

src/path.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -94,27 +94,22 @@ impl Default for LineJoin {
9494

9595
/// `LineCap` specifies the shape to be used at the end of open sub-paths when they are stroked.
9696
/// See [SVG specification](https://www.w3.org/TR/SVG2/painting.html#LineCaps) for more details.
97-
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
97+
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
9898
#[cfg_attr(
9999
feature = "serde",
100100
derive(Serialize, Deserialize),
101101
serde(rename_all = "lowercase")
102102
)]
103103
pub enum LineCap {
104104
/// Connect path segments with straight line.
105+
#[default]
105106
Butt,
106107
/// Add half-square to the end of the segments
107108
Square,
108109
/// Add half-circle to the end of the segments
109110
Round,
110111
}
111112

112-
impl Default for LineCap {
113-
fn default() -> Self {
114-
Self::Butt
115-
}
116-
}
117-
118113
/// Style used to generate stroke
119114
#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Default)]
120115
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]

src/rasterize.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -166,21 +166,16 @@ impl Rasterizer for Box<dyn Rasterizer> {
166166
}
167167
}
168168

169-
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
169+
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default)]
170170
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
171171
pub enum Units {
172172
#[cfg_attr(feature = "serde", serde(rename = "userSpaceOnUse"))]
173+
#[default]
173174
UserSpaceOnUse,
174175
#[cfg_attr(feature = "serde", serde(rename = "objectBoundingBox"))]
175176
BoundingBox,
176177
}
177178

178-
impl Default for Units {
179-
fn default() -> Self {
180-
Self::UserSpaceOnUse
181-
}
182-
}
183-
184179
/// Common interface for anything that can be used to fill an area
185180
pub trait Paint: fmt::Debug {
186181
// Get color at specified point

0 commit comments

Comments
 (0)