mirror of
https://github.com/typst/typst
synced 2025-05-14 04:56:26 +08:00
docs: update comments
This commit is contained in:
parent
cf146b6f4d
commit
2b54c4e86a
@ -645,8 +645,9 @@ impl<'a> GridLayouter<'a> {
|
||||
let width = self.cell_spanned_width(cell, x);
|
||||
let mut pos = Point::new(dx, dy);
|
||||
if self.is_rtl {
|
||||
// In RTL cells expand to the left, thus the position
|
||||
// must additionally be offset by the width of the cell.
|
||||
// In RTL cells expand to the left, thus the
|
||||
// position must additionally be offset by the
|
||||
// cell's width.
|
||||
pos.x = self.width - (dx + width);
|
||||
}
|
||||
let size = Size::new(width, height);
|
||||
@ -1253,7 +1254,7 @@ impl<'a> GridLayouter<'a> {
|
||||
let mut pos = offset;
|
||||
if self.is_rtl {
|
||||
// In RTL cells expand to the left, thus the position
|
||||
// must additionally be offset by the width of the cell.
|
||||
// must additionally be offset by the cell's width.
|
||||
pos.x = self.width - (pos.x + width);
|
||||
}
|
||||
output.push_frame(pos, frame);
|
||||
@ -1301,8 +1302,9 @@ impl<'a> GridLayouter<'a> {
|
||||
for (output, frame) in outputs.iter_mut().zip(fragment) {
|
||||
let mut pos = offset;
|
||||
if self.is_rtl {
|
||||
// In RTL cells expand to the left, thus the position
|
||||
// must additionally be offset by the width of the cell.
|
||||
// In RTL cells expand to the left, thus the
|
||||
// position must additionally be offset by the
|
||||
// cell's width.
|
||||
pos.x = self.width - (offset.x + width);
|
||||
}
|
||||
output.push_frame(pos, frame);
|
||||
|
@ -123,6 +123,8 @@ impl GridLayouter<'_> {
|
||||
};
|
||||
let cell = self.grid.cell(x, y).unwrap();
|
||||
let width = self.cell_spanned_width(cell, x);
|
||||
// In RTL cells expand to the left, thus the position
|
||||
// must additionally be offset by the cell's width.
|
||||
let dx = if self.is_rtl { self.width - (dx + width) } else { dx };
|
||||
|
||||
// Prepare regions.
|
||||
|
Loading…
x
Reference in New Issue
Block a user