feat: change and reset the ruler origin (#1212)

This commit is contained in:
Ikki Nishihara
2026-10-12 15:17:24 +07:00
committed by bflatastic
parent 932c127323
commit 29ecab8c48
25 changed files with 531 additions and 40 deletions
+4
View File
@@ -551,6 +551,9 @@ pub struct Document {
pub template: bool,
#[serde(default)]
pub units: Unit,
/// The rulers' zero point in document coordinates. Moving it changes measurements, never art.
#[serde(default, skip_serializing_if = "skip::is_default")]
pub ruler_origin: Point,
#[serde(default)]
pub color_mode: ColorMode,
pub artboards: Vec<Artboard>,
@@ -706,6 +709,7 @@ impl Document {
title: "Untitled-1".into(),
template: false,
units: Unit::Points,
ruler_origin: Point::ZERO,
color_mode: mode,
artboards: vec![Artboard {
id: 1,