Pad color boxes by fboxsep
This commit is contained in:
1 parent
8e274a252d
commit
0340878909
3 files changed
+19
-10
No files matched your search
@@ -672,12 +672,18 @@ impl Page {
|
||||
} else {
|
||||
flush_link(&mut link_run, &mut list.items);
|
||||
}
|
||||
let padding =
|
||||
if box_.background.is_some() || box_.frame.is_some() {
|
||||
3 * 65_536
|
||||
} else {
|
||||
0
|
||||
};
|
||||
if let Some(background) = box_.background {
|
||||
list.items.push(DisplayItem::Rect {
|
||||
x,
|
||||
y: baseline - box_.height,
|
||||
width: box_.width,
|
||||
height: box_.height + box_.depth,
|
||||
x: x - padding,
|
||||
y: baseline - box_.height - padding,
|
||||
width: box_.width + 2 * padding,
|
||||
height: box_.height + box_.depth + 2 * padding,
|
||||
color: background,
|
||||
});
|
||||
list.items.push(DisplayItem::Fill([0, 0, 0]));
|
||||
@@ -685,10 +691,10 @@ impl Page {
|
||||
}
|
||||
if let Some((frame_color, thickness)) = box_.frame {
|
||||
list.items.push(DisplayItem::Frame {
|
||||
x,
|
||||
y: baseline - box_.height,
|
||||
width: box_.width,
|
||||
height: box_.height + box_.depth,
|
||||
x: x - padding,
|
||||
y: baseline - box_.height - padding,
|
||||
width: box_.width + 2 * padding,
|
||||
height: box_.height + box_.depth + 2 * padding,
|
||||
color: frame_color,
|
||||
thickness,
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user