feat: render pages in Word Processor in same manner as PDF viewer

This commit is contained in:
2026-04-18 17:34:59 +02:00
parent 68464af440
commit 832a52e0a5
+8 -16
View File
@@ -387,22 +387,14 @@ void wp_render() {
// In page view mode, draw the A4 page with shadow before text rendering // In page view mode, draw the A4 page with shadow before text rendering
if (in_page_view) { if (in_page_view) {
// Shadow strips around the page (4 sides + corners, drawn as solid dark rectangles) // Gray background behind page (same style as PDF viewer)
int so = WP_PAGE_SHADOW_OFFSET; Color page_bg = Color::from_rgb(0x80, 0x80, 0x80);
Color shadow_col = Color::from_rgb(0x50, 0x50, 0x50); c.fill_rect(0, edit_y, c.w, text_area_h, page_bg);
// Top shadow (above page, full width)
c.fill_rect(page_x - so, page_y - so, WP_A4_PAGE_W + so * 2, so, shadow_col); // Simple offset shadow (same style as PDF viewer)
// Bottom shadow Color shadow_col = Color::from_rgb(0x60, 0x60, 0x60);
c.fill_rect(page_x - so, page_y + WP_A4_PAGE_H, WP_A4_PAGE_W + so * 2, so, shadow_col); c.fill_rect(page_x + 3, page_y + 3, WP_A4_PAGE_W, WP_A4_PAGE_H, shadow_col);
// Left shadow (vertical strip, excluding corners already covered)
c.fill_rect(page_x - so, page_y, so, WP_A4_PAGE_H, shadow_col);
// Right shadow (vertical strip, excluding corners)
c.fill_rect(page_x + WP_A4_PAGE_W, page_y, so, WP_A4_PAGE_H, shadow_col);
// Corner pieces (top-left, top-right, bottom-left, bottom-right)
c.fill_rect(page_x - so, page_y - so, so, so, shadow_col);
c.fill_rect(page_x + WP_A4_PAGE_W, page_y - so, so, so, shadow_col);
c.fill_rect(page_x - so, page_y + WP_A4_PAGE_H, so, so, shadow_col);
c.fill_rect(page_x + WP_A4_PAGE_W, page_y + WP_A4_PAGE_H, so, so, shadow_col);
// White page background // White page background
c.fill_rect(page_x, page_y, WP_A4_PAGE_W, WP_A4_PAGE_H, colors::WHITE); c.fill_rect(page_x, page_y, WP_A4_PAGE_W, WP_A4_PAGE_H, colors::WHITE);
} }