Skip to content

Commit e3698d8

Browse files
committed
[[ Bug 12804 ]] Compute source rect correctly when starting custom print session.
1 parent 264107f commit e3698d8

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

docs/notes/bugfix-12804.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Clipping incorrect when printing to PDF.

engine/src/customprinter.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1302,10 +1302,12 @@ MCPrinterResult MCCustomPrinterDevice::Begin(const MCPrinterRectangle& p_src_rec
13021302
if (!StartPage())
13031303
return PRINTER_RESULT_ERROR;
13041304

1305+
// MW-2014-07-30: [[ Bug 12804 ]] Make sure we get left / top round the right way else clipping
1306+
// is wrong.
13051307
// Calculate the convex integer hull of the source rectangle.
13061308
MCRectangle t_src_rect_hull;
1307-
t_src_rect_hull . x = (int2)floor(p_src_rect . top);
1308-
t_src_rect_hull . y = (int2)floor(p_src_rect . left);
1309+
t_src_rect_hull . x = (int2)floor(p_src_rect . left);
1310+
t_src_rect_hull . y = (int2)floor(p_src_rect . top);
13091311
t_src_rect_hull . width = (uint2)(ceil(p_src_rect . right) - floor(p_src_rect . left));
13101312
t_src_rect_hull . height = (uint2)(ceil(p_src_rect . bottom) - floor(p_src_rect . top));
13111313

0 commit comments

Comments
 (0)