fix: snap to grid for style (#805)

main
bokuweb 2025-02-27 15:53:59 +09:00 committed by GitHub
parent 0cc65144d1
commit 9b8c8b6e97
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 12 additions and 1 deletions

View File

@ -130,6 +130,11 @@ impl Style {
self
}
pub fn snap_to_grid(mut self, v: bool) -> Self {
self.paragraph_property = self.paragraph_property.snap_to_grid(v);
self
}
pub fn indent(
mut self,
left: Option<i32>,

View File

@ -5,5 +5,6 @@ pub fn toc(level: i32) -> Style {
Style::new(format!("ToC{}", level), StyleType::Paragraph)
.name(format!("toc {}", level))
.align(AlignmentType::Both)
.snap_to_grid(false)
.indent(Some((level - 1) * 200), None, None, Some((level - 1) * 100))
}

View File

@ -189,6 +189,11 @@ export class Style {
return this;
}
snapToGrid(v: boolean) {
this._paragraphProperty._snapToGrid = v;
return this;
}
pageBreakBefore(v: boolean) {
this._paragraphProperty.pageBreakBefore = v;
return this;

View File

@ -1,6 +1,6 @@
{
"name": "docx-wasm",
"version": "0.4.18-rc38",
"version": "0.4.18-rc39",
"main": "dist/node/index.js",
"browser": "dist/web/index.js",
"author": "bokuweb <bokuweb12@gmail.com>",