mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-10-01 07:48:11 +08:00
Fix click target not extending to correct limit for aligned strokes (#3065)
Fixes #3047
This commit is contained in:
@@ -371,6 +371,16 @@ impl Stroke {
|
|||||||
self.weight
|
self.weight
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Get the effective stroke weight.
|
||||||
|
pub fn effective_width(&self) -> f64 {
|
||||||
|
self.weight
|
||||||
|
* match self.align {
|
||||||
|
StrokeAlign::Center => 1.,
|
||||||
|
StrokeAlign::Inside => 0.,
|
||||||
|
StrokeAlign::Outside => 2.,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pub fn dash_lengths(&self) -> String {
|
pub fn dash_lengths(&self) -> String {
|
||||||
if self.dash_lengths.is_empty() {
|
if self.dash_lengths.is_empty() {
|
||||||
"none".to_string()
|
"none".to_string()
|
||||||
|
|||||||
@@ -988,7 +988,7 @@ impl Render for Table<Vector> {
|
|||||||
let vector = row.element;
|
let vector = row.element;
|
||||||
|
|
||||||
if let Some(element_id) = element_id {
|
if let Some(element_id) = element_id {
|
||||||
let stroke_width = vector.style.stroke().as_ref().map_or(0., Stroke::weight);
|
let stroke_width = vector.style.stroke().as_ref().map_or(0., Stroke::effective_width);
|
||||||
let filled = vector.style.fill() != &Fill::None;
|
let filled = vector.style.fill() != &Fill::None;
|
||||||
let fill = |mut subpath: Subpath<_>| {
|
let fill = |mut subpath: Subpath<_>| {
|
||||||
if filled {
|
if filled {
|
||||||
|
|||||||
Reference in New Issue
Block a user