mirror of
https://github.com/storytold/designcraft.git
synced 2026-11-17 15:46:58 +00:00
Draw a checkbox's border at the item's stroke weight
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
516998d449
commit
44b07403b1
1 file changed
+1
-1
@@ -179,7 +179,7 @@ pub(crate) fn add_fields(pdf: &[u8], fields: &[Placed], media: &[PlacedMedia]) -
|
||||
FieldKind::CheckBox => {
|
||||
// Appearances: an empty box, and a box with a check mark.
|
||||
let border =
|
||||
if *bw > 0.0 { format!("0.45 G 1 w 0.5 0.5 {:.2} {:.2} re S", (w - 1.0).max(0.0), (h - 1.0).max(0.0)) } else { String::new() };
|
||||
if *bw > 0.0 { format!("0.45 G {bw:.2} w {i:.2} {i:.2} {:.2} {:.2} re S", (w - bw).max(0.0), (h - bw).max(0.0), i = bw / 2.0) } else { String::new() };
|
||||
let check = format!(
|
||||
"{border} 0 g {:.2} w 1 J 1 j {:.2} {:.2} m {:.2} {:.2} l {:.2} {:.2} l S",
|
||||
(w.min(h) * 0.12).max(0.8),
|
||||
|
||||
Reference in new issue
Block a user