Re: Patch

> So the deal here is that (xoffset, yoffset) is the position of the
> drawable you are drawing to in GtkTextLayout overall coordinates.
> If your drawable is at 1,1 then you want to draw the region starting 
> at (1,1) in the entire layout on (0,0) of that drawable.
> I'm referring to my book here because I never remember all this. ;-)
> Anyway, sections 13.2.3 and 12.2.2 are maybe useful.

Right. That is what I am doing. I guess my point was that setting a
positive offset on the drawable effectively moves things up and to the
left, you would need to have negative values to move it down and to the
right. And this is what I am getting in the method in canvas pixel

> I'm not sure what happens when you consider zooming in all this.

I'd rather not think about it right now. ;)

> > If you understand and I'm not totally on crack, I can commit to remove
> > the assertion against negative offsets.
> I think you do need to do this, since the canvas can give you a
> drawable that covers (0,0) of the canvas item and extends
> upward/leftward of it.

Yes, this is what is happening in my test case.

> However I think the code in gtktextdisplay.c should establish a clip
> rect that avoids drawing outside of (0,0) (width,height) in layout
> coords, and it needs checking in general to be sure it works with
> negative coords.

I'll look into this if someone doesn't beat me to it.


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