Linewidth of a graphic not working correct

tkuypers at pandora.be tkuypers at pandora.be
Thu Jul 17 17:33:01 EDT 2003


Dar,

As the poster of this bug, I think you misunderstood the problem. Probably I
just didn't explain it the right way...

When I create a graphic of 100x100 pixels and set the linewidth of it to 1,
3, 5, etc. pixels, the item shows its lines exactly at the size of 100
pixels. Just put a colored graphic without lines on top of it and you'll see
they match.

When you do the same thing with graphics having a linewidth of 2, 4, 6, etc.
pixels, the box you see (the right and bottom line) are moved 1 pixel to the
inside, so what you see is a box of 99x99 pixels.

In one of our projects the user can draw rectangles on screen, using a
user-definable grid. But because of this strange behaviour the drawn
rectangles will never be the correct size (so they won't touch each other)
when drawing within the grid. There will always be a gap of one pixel
between to rectangles...

I don't think this has to to anything with me being a newby, or rendering of
graphics, there is just something missing in the way these graphics are
drawn on screen... The visual boundaries (the 8 "resize" handles) shown on
screen are in the right position, just the lines aren't...

Hope this gives you the proper information to solve this, because I still
think this IS a bug...

Warm regards,

Ton Kuypers



> From: Dar Scott <dsc at swcp.com>
> Reply-To: use-revolution at lists.runrev.com
> Date: Thu, 17 Jul 2003 15:21:27 -0600
> To: use-revolution at lists.runrev.com
> Subject: Re: Linewidth of a graphic not working correct
> 
> 
> On Wednesday, June 11, 2003, at 01:56 AM, tkuypers at pandora.be wrote:
> 
>> When changing the bordersize from an odd number to even, you the right
>> and
>> bottom of this object are not set correctly, the line gets thicker,
>> but is 1
>> pixels smaller than the actual rect... So, using a borderwidth of 1,
>> 3, 5,
>> etc. works the way it is supposed to do, but 2, 4, 6, etc. gives a
>> visual
>> discrepancy...)
>> 
>> This makes it impossible to create exact images :-(
> 
> In a discussion on this issue, Scott Raney suggested the use of the
> borderWidth property as a workaround for rectangles.
> 
> I think this will work OK for rectangles on both Windows and OS X.  Set
> your lineSize to 0.  That is the size on the first page of the object
> inspector.  Set showBorder to true.  Set threeD to false.  Set the
> border size with borderWidth.
> 
> You may need to experiment with how that might apply to other objects.
> 
> (The meaning of the graphic properties of Revolution objects seems to
> be essentially a set of calls to the OS drawing API, the meaning of
> which--in terms of parameter meaning and rendering meanings--will vary
> slightly from platform to platform.  I don't expect this to change.)
> 
> Dar Scott
> 
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/use-revolution
> 
> 




More information about the use-livecode mailing list