Bug 49438 - TABLES: drawing layer doesn't paint thin borders in Writer if anti-aliasing disabled
Summary: TABLES: drawing layer doesn't paint thin borders in Writer if anti-aliasing d...
Status: CLOSED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
Master old -3.6
Hardware: All All
: medium normal
Assignee: Michael Stahl (allotropia)
URL:
Whiteboard: target:3.6.0 target:3.5.5
Keywords: regression
Depends on:
Blocks:
 
Reported: 2012-05-03 10:29 UTC by Michael Stahl (allotropia)
Modified: 2012-07-12 11:40 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
pseudo hack to "fix" problem (12.68 KB, patch)
2012-05-04 13:32 UTC, Michael Stahl (allotropia)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Stahl (allotropia) 2012-05-03 10:29:31 UTC
1. disable anti-aliasing
   Tools->Options->LibreOffice->View, uncheck "Use Anti-Aliasing"
2. new writer document
3. Table->Insert->Table, check "border" checkbox
4. table is difficult to see because no borders are displayed on 100% zoom

this bug is a regression from the fix for bug 33634,
this commit changed the hairline predicates so it does
not ever return true for any Writer border, which have
a minimum width of 1 Twip:

http://cgit.freedesktop.org/libreoffice/core/commit/?id=2c91cb08d65cd35fa8ef6eaca3677aa82fb58cbe

so while with anti-aliasing there doesn't seem to be much
difference whether thin borders are drawn as hairlines or not,
the non-anti-aliased drawing is very sensitive to getting
it right.

afaik drawing layer uses twips in Writer and 1/100mm in other
applications; probably need some way to make the predicate
dependent on the application.
Comment 1 Thorsten Behrens (allotropia) 2012-05-04 00:15:41 UTC
(In reply to comment #0)
> afaik drawing layer uses twips in Writer and 1/100mm in other
> applications; probably need some way to make the predicate
> dependent on the application.
>
Yes to the premise - not sure if a hard limit cuts it here, though - you'll always in danger of getting round-offs & falling over the cliff - hairline magic number at other places is zero, btw, that relatively faithfully survives calculations. ;)
Comment 2 Roman Eisele 2012-05-04 07:22:16 UTC
This is a Writer issue, at least as reported here, therefore changed the 'Component' field accordingly. Adding 'TABLES' keyword. (Don't kill me if I got it wrong, I just want to help a bit to make finding bug reports easier.)
Comment 3 Michael Stahl (allotropia) 2012-05-04 07:53:24 UTC
zero already represents "no border" here;
also i just found out that it's possible to get invisible lines
in Calc as well by setting 0.05pt wide borders via Format->Cells,
which results in 0.06 1/100mm border width,
larger than the 0.01 1/100mm hairline limit.

so perhaps either that limit is _also_ wrong,
or it's a bug that the non-anti-aliased drawing code
won't draw such thin lines.
Comment 4 Markus Mohrhard 2012-05-04 08:58:57 UTC
(In reply to comment #3)
> zero already represents "no border" here;
> also i just found out that it's possible to get invisible lines
> in Calc as well by setting 0.05pt wide borders via Format->Cells,
> which results in 0.06 1/100mm border width,
> larger than the 0.01 1/100mm hairline limit.

hairline limit for calc should be 0.1

I suppose that we have then a bug in the drawinglayer with hairlines and I found some comments in calc bug fixes for drawing borders mentioning drawing problems for 1pixel width borders.
Comment 5 Michael Stahl (allotropia) 2012-05-04 13:28:41 UTC
sorry i managed to confuse myself horribly with this with local changes; it is indeed 0.1 and the problem does exist just with different numbers: insert a border with 0.05pt, zoom 180% i get mfLeftWidth 0.11 and an invisible border (while for lower zoom it is detected as hairline and displayed)
Comment 6 Michael Stahl (allotropia) 2012-05-04 13:32:36 UTC
Created attachment 61047 [details]
pseudo hack to "fix" problem

i'll attach a horrible pseudo hack to try to use hairlines for lines
less than 0.5 pixels wide (which seems to be the limit where
non-anti-aliased drawing cuts off), which somehow seems to
superficially fix the problem but is probably completely wrong
just so that tbehrens can ridicule it and replace it with
something that does the right thing.
Comment 7 Thorsten Behrens (allotropia) 2012-05-07 05:38:57 UTC
(In reply to comment #6)
> just so that tbehrens can ridicule it and replace it with
> something that does the right thing.
>
Nice job. So not only do I now have to come up with a fix, it even has to be uber-cool?! ;)
Comment 8 Not Assigned 2012-06-05 06:35:38 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "libreoffice-3-6":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=8fd62d93d583a1ed67a7cea76b51acc104aeaa08&g=libreoffice-3-6

fdo#49438: heuristic pseudo-hack to use hair-lines if width <= 0.5 pixel


It will be available in LibreOffice 3.6.0.
Comment 9 Not Assigned 2012-06-05 06:36:02 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=ee42895d684be9430a414adf3f569d279d437148

fdo#49438: heuristic pseudo-hack to use hair-lines if width <= 0.5 pixel
Comment 10 Not Assigned 2012-06-06 01:52:29 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "libreoffice-3-5":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=ae6dbb573e4cd992b1ad92325203c721b3c8e8ab&g=libreoffice-3-5

fdo#49438: heuristic pseudo-hack to use hair-lines if width <= 0.5 pixel


It will be available in LibreOffice 3.5.5.
Comment 11 Michael Stahl (allotropia) 2012-06-11 11:58:35 UTC
just for the record, the commit in comment #8 introduced
a problem with drawing of double borders that is fixed here:

http://cgit.freedesktop.org/libreoffice/core/commit/?id=0044bd800b742f28056805bb163ff243cf4095f3
Comment 12 Caolán McNamara 2012-06-28 08:12:03 UTC
this is fixed, right ?
Comment 13 Michael Stahl (allotropia) 2012-06-29 14:30:04 UTC
well since Thorsten doesn't have time to review my patch we'll just have to live with the consequences of my ignorance of all things graphics :)
Comment 14 Thorsten Behrens (allotropia) 2012-07-12 11:40:33 UTC
(In reply to comment #13)
> well since Thorsten doesn't have time to review my patch we'll just have to
> live with the consequences of my ignorance of all things graphics :)
>
Patch is good enough I guess - wasn't immediately able to come up with anything better. :)