Le 13/01/2015 01:22, Uwe Stöhr a écrit :
My change allowed to set the line width to any value you like. As i had
to set a default width I chose 0.5 because this is already a LaTeX
default width (if I remember correctly).
Anyway, the thickness must be a float to allow full control of the line
width.
You can use whatever you want, but pixels are pixels. At the end the
width of the line will be an integer. The only reason why
QPen::setWidthF exists is that one may have transformed the painter
space so that, for example the unit is millimeter (think printer). This
is not the case here obviously.
I therefore think that your change
http://www.lyx.org/trac/changeset/6e519e7727f2d7f32a6f501fb4546bfab4c7f3b1/lyxgit
is not correct. You force to use an int.
I force to use an int for a x coordinate. Last time I checked these are
still ints. Actually this is the very reason why your compiler produced
a warning and I had to change the code.
But what if one wants to have
0.4 as dotted line width? 0.4 is visible and not zero.
It just works. From the QPen::setWidth documentation:
void QPen::setWidth(int width)
Sets the pen width to the given width in pixels with integer
precision.
A line width of zero indicates a cosmetic pen. This means that the
pen width is always drawn one pixel wide, independent of the
transformation set on the painter.
So the conclusion IMO is that we should turn these pen width variables
to ints.
JMarc