core: Fix incorrect closing of paths in drawing API (fix #5598)
The path starting position was not being set correctly after a moveTo command, which could cause stray strokes to appear in the drawing. Fixes #5598, #5768, #5957.
This commit is contained in:
parent
655adedc1c
commit
34ed9cbbaa
|
@ -142,10 +142,10 @@ impl Drawing {
|
|||
}
|
||||
|
||||
pub fn draw_command(&mut self, command: DrawCommand) {
|
||||
let add_to_bounds = if let DrawCommand::MoveTo { .. } = command {
|
||||
let add_to_bounds = if let DrawCommand::MoveTo { x, y } = command {
|
||||
// Close any pending fills before moving.
|
||||
self.close_path();
|
||||
self.fill_start = self.cursor;
|
||||
self.fill_start = (x, y);
|
||||
false
|
||||
} else {
|
||||
true
|
||||
|
|
Loading…
Reference in New Issue