mirror of
https://github.com/penpot/penpot.git
synced 2025-05-13 22:16:37 +02:00
🐛 Fix dotted path widh calculation
This commit is contained in:
parent
98806defbf
commit
bb071489f1
1 changed files with 8 additions and 3 deletions
|
@ -32,7 +32,7 @@ pub enum StrokeCap {
|
||||||
// Square,
|
// Square,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, PartialEq)]
|
#[derive(Debug, Clone, Copy, PartialEq)]
|
||||||
pub enum StrokeKind {
|
pub enum StrokeKind {
|
||||||
InnerStroke,
|
InnerStroke,
|
||||||
OuterStroke,
|
OuterStroke,
|
||||||
|
@ -55,7 +55,7 @@ impl Stroke {
|
||||||
if is_open {
|
if is_open {
|
||||||
StrokeKind::CenterStroke
|
StrokeKind::CenterStroke
|
||||||
} else {
|
} else {
|
||||||
self.kind.clone()
|
self.kind
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -133,7 +133,12 @@ impl Stroke {
|
||||||
let path_effect = match self.style {
|
let path_effect = match self.style {
|
||||||
StrokeStyle::Dotted => {
|
StrokeStyle::Dotted => {
|
||||||
let mut circle_path = skia::Path::new();
|
let mut circle_path = skia::Path::new();
|
||||||
circle_path.add_circle((0.0, 0.0), self.width / 2.0, None);
|
let width = match self.kind {
|
||||||
|
StrokeKind::InnerStroke => self.width,
|
||||||
|
StrokeKind::CenterStroke => self.width / 2.0,
|
||||||
|
StrokeKind::OuterStroke => self.width,
|
||||||
|
};
|
||||||
|
circle_path.add_circle((0.0, 0.0), width, None);
|
||||||
let advance = self.width + 5.0;
|
let advance = self.width + 5.0;
|
||||||
skia::PathEffect::path_1d(
|
skia::PathEffect::path_1d(
|
||||||
&circle_path,
|
&circle_path,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue