Thanks master
tybalt89 for your insights,
- 1 yes with -highlightthickness => 0 as in your example everything is looking better. You set this on the main canvas and if I understand affects the frame where rectangles will be drown. But in effect this looks ok until -outline => undef is there. I'm starting to doubt that -outline => undef means a transparent outline: probably it means no outline at all so less pixel used.
Compare difference if you comment/uncomment -outline => undef in the following snippet:
use Tk;
my $mw = Tk::MainWindow->new();
my $can = $mw->Canvas(
-height => 100,
-width => 100 ,
-bg => 'red',
-highlightthickness => 0,
)->pack( );
$can->createRectangle(0,0,101,101,
-fill => 'gold2',
#-outline => undef ,
#-width => 10,
);
MainLoop;
With #-outline => undef , the black, 1px outline is shown in North and West sides but no in other ones. This seems to prove that the outline width is added to. By other hand with -outline => undef no red background in shown so the yellow square fills the correct 100x100 region.
The weird part is that it seems that just first pixel is managed in this way, ie shifting the yellow square toward SE: infact using -width => 10 (the width of the outline!) the yellow square remains centerd..
- 2 Thanks i overlooked this part of the docs.. So I must always consider 1 pixel more while drawing rectangles, even with no outline.
L*
There are no rules, there are no thumbs..
Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.