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

RE: [XaraXtreme-dev] New Ruler functions

Yes, I have tried it and no, it really did not work, but in the 
meantime I have rewritten it in a different way, which works.

As you wrote, it would have made sense to handle it like the spread 
origin, but your new code did not do that. Basically, you need to use 
the temporary offset twice, once when working out which logical 
graticules fall into the redraw region and once you have found them 
you need to apply the offset again in the different direction when 
computing the graticule positions on screen.

The existing code for the spread origin works that way, though 
indirectly because the origin offset is applied in the spread 
coordinate conversion routine, which is called in each of the two 
steps I outlined above.


In message <5056CBC646CB4047BB26120F4377DB71D71CDE@xxxxxxxxxxxxxxxxxxx 
          "Phil Martin" <Phil@xxxxxxxx> wrote:

> I don't agree.
> GetRulerCoord is used only by the code that is working our how to space
> out the graticules on the ruler, how to draw them and how to label them.
> It has no effect on redraw rectangles at all - just on coords shown to
> the user within those rectangles.
> It is, I admit, untested but it's just a simple extension of the code
> that already modifies the displayed coords to take the user-settable
> page origin into account and it seems to be doing the intended job to
> me. Have you tried it?
> Phil
>> -----Original Message-----
>> From: owner-dev@xxxxxxxxxxxxxxxx
>> [mailto:owner-dev@xxxxxxxxxxxxxxxx] On Behalf Of Martin Wuerthner
>> Sent: 06 July 2006 12:44
>> To: dev@xxxxxxxxxxxxxx
>> Subject: Re: [XaraXtreme-dev] New Ruler functions
>> In message <50B23B32-A1A9-469F-A183-4DA2162B7023@xxxxxxxx>
>>           Phil Martin <phil@xxxxxxxx> wrote:
>> > GetRulerCoord(DocRect, UserRect*)
>> > Override to make rulers show coordinates in any coordinate space of
>> > the tool's choosing by converting the supplied DocRect into
>> the output
>> > UserRect. The UserRect is by default already filled in with the
>> > rectangle in standard UserCoords (simply SpreadCoords translated to
>> > UserOrigin).
>> > If you override this you will need to repaint the rulers on
>> entry and
>> > exit from your tool.
>> Sorry, this cannot work. The UserRect the current tool can
>> modify via this method is simply the area on screen to be
>> redrawn, so by changing this rectangle, all the tool can do
>> is prevent some part of the ruler from being redrawn. The
>> relationship between displayed ruler coordinates and the page
>> coordinates remains the same.
>> Martin