gnustep-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Testing for drawing fixes r30523


From: Quentin Mathé
Subject: Re: Testing for drawing fixes r30523
Date: Thu, 3 Jun 2010 12:46:13 +0200

Hi Doug,

Le 2 juin 2010 à 21:36, Doug Simons a écrit :

This change has broken some things on Windows. Here is a screenshot from our application showing the problem, with an image displayed in a tableView (the table here contains only one row):

<Untitled Image.png>

When I roll back this change, it displays as it should:

<Untitled Image 2.png>

It's hard to tell from this particular image, but the image itself is not flipped, just displaced. Hopefully that's enough for you to tell what's going on. If you need additional information please let me know.

I think the backend is trying to compensate/revert an extra flipping previously done in Gui. The code where the problem is located is -[Win32GState compositeGState:fromRect:toPoint:op:fraction:] pasted below.

The implementation looks similar to the old Cairo implementation, so the best way is probably to rewrite it in a similar way. That means I have to set up Windows somewhere since it's hard to get the implementation right. I don't have time today, but tomorrow I'll try to get a working GNUstep install on Windows to work on it.

By the way, does the scrolling still work on Windows?

if (viewIsFlipped && (self
 != source))
    {
      destPoint.y -= sourceRect.size.height;
    }

You can try to remove this part since the backend shouldn't need it now. But I I don't think it's enough to fix it.

  destRect.origin = destPoint;
  destRect.size = sourceRect.size;
  [ctm boundingRectFor: destRect result: &destRect];

The transform should be applied to destPoint only here.

  rectTo = GSWindowRectToMS(
self
, destRect);
  x = rectTo.left;
  y = rectTo.bottom - sourceRect.size.height;

  {
    NSRect newRect;

    [source->ctm boundingRectFor: sourceRect result: &newRect];
    rectFrom = GSWindowRectToMS(source, newRect);
    y += (sourceRect.size.height - newRect.size.height);
// adjust location for scaled source

The line before the last one looks dubious to me. To get it working properly in all cases (rotation, scaling, flipping etc.), I had to rewrite the Cairo backend to use a more complex check.

Thanks for feedback,
Quentin.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]