Bug 148701 - Incorrect tiled rendering of form elements in Writer doc
Summary: Incorrect tiled rendering of form elements in Writer doc
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Android Viewer (show other bugs)
Version:
(earliest affected)
7.3.0.3 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: bibisected, bisected, regression
Depends on:
Blocks:
 
Reported: 2022-04-21 07:50 UTC by Michael Weghorn
Modified: 2023-08-31 08:32 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
Screencast for Android Viewer (408.80 KB, video/x-matroska)
2022-04-21 07:50 UTC, Michael Weghorn
Details
Screencast for gtktiledviewer (844.74 KB, video/x-matroska)
2022-04-21 07:51 UTC, Michael Weghorn
Details
Screenshot with master as of 8dc8ffff443c3b13e8782fdbaf61594056df8126 (65.62 KB, image/png)
2023-03-08 09:06 UTC, Michael Weghorn
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Weghorn 2022-04-21 07:50:44 UTC
Created attachment 179698 [details]
Screencast for Android Viewer

Steps to reproduce:

1) open attachment 179504 [details] from bug 148553 in Android Viewer
2) zoom in and out
3) look at the document

Actual result:
The checkboxes as well as the values in the form fields are rendered incorrectly (either too large or too tiny) at least at some soom levels.

Expected result:
Everything should become larger/smaller according to the zoom level.

This is also reproducible with gtktiledviewer:

    ./bin/run gtktiledviewer --lo-path=$(pwd)/instdir/program  /tmp/form_sample.odt

Screencasts will be attached.

This is with git master as of commit 5d56255c22c79b72c1cedb48cfe0a200f89bdc66.
Comment 1 Michael Weghorn 2022-04-21 07:51:11 UTC
Created attachment 179699 [details]
Screencast for gtktiledviewer
Comment 2 Aron Budea 2022-05-21 23:31:18 UTC
This is a regression from the following commit, bibisected using repo bibisect-linux-64-7.3, using gtktiledviewer (one can copy over the relevant files from a local build).

https://cgit.freedesktop.org/libreoffice/core/commit/?id=9b73d3e8926d5f9b10464d19b539eef3eb088f50
author		Luboš Luňák <l.lunak@collabora.com>	2021-07-22 22:07:42 +0200
committer	Luboš Luňák <l.lunak@collabora.com>	2021-09-08 10:31:32 +0200

"avoid painting to windows in LOK mode"

There were also a few other commits that further affected the behavior:

https://cgit.freedesktop.org/libreoffice/core/commit/?id=1728367684602bb897fd9a8518c40b071cb55a22
author		Luboš Luňák <l.lunak@collabora.com>	2021-11-22 18:17:10 +0100
committer	Luboš Luňák <l.lunak@collabora.com>	2021-11-23 14:31:16 +0100

"avoid only painting to windows in LOK mode, not invalidations"

https://cgit.freedesktop.org/libreoffice/core/commit/?id=057968bbce406efe6564347329df45b7e0f823ce
author		Luboš Luňák <l.lunak@collabora.com>	2021-10-05 14:30:44 +0200
committer	Luboš Luňák <l.lunak@collabora.com>	2021-10-05 22:01:48 +0200

"do not block out PaintImmediately() in LOK mode"
Comment 3 Michael Weghorn 2023-03-08 09:06:13 UTC
Created attachment 185832 [details]
Screenshot with master as of 8dc8ffff443c3b13e8782fdbaf61594056df8126

In a quick test with gtktiledviewer, the following commit significantly improved the situation and zooming in/out now makes the form text become larger/smaller as expected.

What remains is that the text becomes blurry when zooming in, s. attached screenshot.

commit 7adfecb0f5947ae258226c8d1652546f81577026
Author: Marco Cecchetti
Date:   Sun Feb 5 17:47:34 2023 +0100

    lok: form controls: rendering and mouse event forwarding
    
    What we got
    - Most controls rendered on Writer and Impress (on Calc already
    implemented by Tomaž Vajngerl)
    - Text labels rendered correctly
    - Mouse events forwarded to controls
    - Control state changed on click for Writer and Calc
    - Control invalidation for all apps
    - Fixed broken LOK_CALLBACK_MOUSE_POINTER msg
    - Correct pointer style when mouse is hovering over a control
    
    Need to be improved
    - in impress click method for a control is not executed even if the
    mouse event is forwarded correctly
    - avoid not needed control invalidations (as the one occurring on
    document autosaving)
    
    Change-Id: I4d5012af7f90a2c726b6b6b5b068e2be1ed5568a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146569
    Tested-by: Jenkins CollaboraOffice
    Reviewed-by: Tomaž Vajngerl
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147320
    Tested-by: Jenkins
    Reviewed-by: Marco Cecchetti
Comment 4 Thorsten Behrens (allotropia) 2023-08-31 08:32:25 UTC
Checked extensively with Armin, the remaining blur is a bit of a catch22. If we need to avoid rounding errors with the current integer-based view plumbing, we need to setup rendering of form controls as done via 7adfecb0f5947ae258226c8d1652546f81577026.

If we change the zoom, to get higher-res bitmaps, then the rounding errors and slightly-off text scalings happen again. I would argue the current solution is the best we can do, with what the architecture can deliver.