mirror of
https://github.com/storytold/winprint.rs.git
synced 2026-11-15 06:44:28 +00:00
fix(win-pdf): stay pixel exact by transform based on final size
Co-Authored-By: Justin Capella <4584655+b1tninja@users.noreply.github.com> Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 file changed
+4
-1
@@ -144,7 +144,10 @@ impl FilePrinter for WinPdfPrinter {
|
||||
.map_err(WinPdfPrinterError::RenderError)?;
|
||||
d2d_context.SetTarget(&command_list);
|
||||
d2d_context.BeginDraw();
|
||||
d2d_context.SetTransform(&Matrix3x2::scale(scale.0.recip(), scale.1.recip()));
|
||||
d2d_context.SetTransform(&Matrix3x2::scale(
|
||||
pdf_size.Width / pdf_render_options.DestinationWidth as f32,
|
||||
pdf_size.Height / pdf_render_options.DestinationHeight as f32,
|
||||
));
|
||||
let rendered = pdf_renderer.RenderPageToDeviceContext(
|
||||
&pdf_page,
|
||||
d2d_context,
|
||||
|
||||
Reference in new issue
Block a user