Well, at least it now displays something.
The good thing with this port and starting by a single component is that it
forces me to make it independant of the rest of the GUI, thus fixing the
design 'shortcuts' we took. Chris, you might want to consider this way for
the notation work you were planning to do.
From: Chris Cannam <cannam@al...> - 2007-09-07 10:29:26
On Thursday 06 September 2007 22:56, Guillaume Laurent wrote:
> Well, at least it now displays something.
Exciting! I'll have to have a look at it.
One point about this is that we need to make extra certain that our horizontal
and vertical grid lines are always single-pixel lines regardless of zoom
level, i.e. that Qt is not "antialiasing" them and fuzzing the result. This
will apply for notation etc as well. On the screenshot you attached, the
horizontal lines are fine but the vertical ones are fuzzed.
On Sep 7, 2007, at 12:30 PM, Chris Cannam wrote:
> One point about this is that we need to make extra certain that our
> and vertical grid lines are always single-pixel lines regardless of
> level, i.e. that Qt is not "antialiasing" them and fuzzing the
> result. This
> will apply for notation etc as well. On the screenshot you
> attached, the
> horizontal lines are fine but the vertical ones are fuzzed.
I haven't looked at zooming yet. In any case, there, there's the
QGraphicsItem::ItemIgnoresTransformations flag :
From: Chris Cannam <cannam@al...> - 2007-09-07 20:17:02
On 07/09/2007, Guillaume Laurent <glaurent@...> wrote:
> I haven't looked at zooming yet.
Sure, but the point is that the vertical lines are fuzzy in the
picture you attached, before zooming was even an issue. We'll need to
ensure that that doesn't happen, somehow. Ignoring transformations is
kind of beside the point if the problem happens even before the
transformations have been applied. Besides, we don't want the lines
to ignore transformations, because they wouldn't stretch to the full
width/height of the zoomed canvas.
When you draw with a painter in Qt4, the painter has an option to set
whether you want antialiasing or not. If you disable antialiasing and
draw a vertical line using a painter with pen width 1, you get a
single-pixel line. If you enable antialiasing and draw the same line,
the line will be fuzzed across two pixels at levels depending on where
its nominal centre is, which depends on how close to the nearest
integer the presumably floating-point x-coordinate is. If the
x-coordinate happens to be an exact integer, the line will be centred
on the boundary between two pixels and will therefore be a two-pixel
wide fuzz. To get a single-pixel line, you either have to ensure that
the line is centred at some integer plus 0.5 (after zoom and other
transformations), or you have to disable antialiasing for that line