2 registered members (AndrewAMD, 7th_zorro),
1,285
guests, and 4
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
troubles with scale_x & scale_y
#338403
08/17/10 22:16
08/17/10 22:16
|
Joined: Dec 2008
Posts: 605 47°19'02.40" N 8°32'54.67" E...
hopfel
OP
User
|
OP
User
Joined: Dec 2008
Posts: 605
47°19'02.40" N 8°32'54.67" E...
|
Hi dear community, I feel a bit discouraged because I'm to stupid to scale a panel the right way. o.0 I used this little code in one of my functions in my script:
my_panel.scale_x=12;
my_panel.scale_y=12;
But this happened ingame to my 16*16 panel: The border should be constant, but here it's deformed. And it's really just the border, the middle of the panel is scaled right. This happens with other panels too. I really don't know what the problem could be like... Anyone an idea?
Hilf mir, dir zu helfen!
|
|
|
Re: troubles with scale_x & scale_y
[Re: hopfel]
#338456
08/18/10 12:37
08/18/10 12:37
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
Expert
|
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
Nah, just think it through. I'll try to explain though, its not easy. [sticking to 'square' scaling for simplicity]
If scales are at 1.0, all pixels are 1x1 in size. If scales are at 2.0, all pixels are 2x2 in size. If scales are at 3.0, all pixels are 3x3 in size. etc...
BUT!!! If scales are at 1.5, SOME pixels are 1x1, and some are 2X2, because you cant make a pixel 1.5x1.5
SO. If you lock your scales to ONLY INTEGERS, the problem will go away. But the higher your scale gets, the 'chunkier' each step will become...
Get what I mean?
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
Re: troubles with scale_x & scale_y
[Re: EvilSOB]
#338462
08/18/10 13:06
08/18/10 13:06
|
Joined: Jul 2008
Posts: 1,178 England
MrGuest
Serious User
|
Serious User
Joined: Jul 2008
Posts: 1,178
England
|
Nah, just think it through. I'll try to explain though, its not easy. [sticking to 'square' scaling for simplicity]
If scales are at 1.0, all pixels are 1x1 in size. If scales are at 2.0, all pixels are 2x2 in size. If scales are at 3.0, all pixels are 3x3 in size. etc...
BUT!!! If scales are at 1.5, SOME pixels are 1x1, and some are 2X2, because you cant make a pixel 1.5x1.5
SO. If you lock your scales to ONLY INTEGERS, the problem will go away. But the higher your scale gets, the 'chunkier' each step will become...
Get what I mean?
AFAIK he is using integers? just tested it, and having the same issue when scaling with integers, possible temp fix
pnl.size_x--;pnl.size_y--;
?
|
|
|
Re: troubles with scale_x & scale_y
[Re: bart_the_13th]
#338470
08/18/10 14:01
08/18/10 14:01
|
Joined: Dec 2008
Posts: 605 47°19'02.40" N 8°32'54.67" E...
hopfel
OP
User
|
OP
User
Joined: Dec 2008
Posts: 605
47°19'02.40" N 8°32'54.67" E...
|
First thanks for all responses! @EvilSOB: How MrGuest said, I'm already using integer. @MrGuest: It's for the zoom-function of a little paint-program. So the only possible temp fix for me is to make an own scale-function using pixel-functions... @bart_the_13th: No, it hasn't.
Hilf mir, dir zu helfen!
|
|
|
Re: troubles with scale_x & scale_y
[Re: hopfel]
#338475
08/18/10 14:24
08/18/10 14:24
|
Joined: Oct 2007
Posts: 5,210 Ä°stanbul, Turkey
Quad
Senior Expert
|
Senior Expert
Joined: Oct 2007
Posts: 5,210
Ä°stanbul, Turkey
|
maybe try using powers of 2? 2 4 16 32 etc (disregard the +10 limit)
3333333333
|
|
|
Re: troubles with scale_x & scale_y
[Re: hopfel]
#338491
08/18/10 15:01
08/18/10 15:01
|
Joined: Oct 2007
Posts: 5,210 Ä°stanbul, Turkey
Quad
Senior Expert
|
Senior Expert
Joined: Oct 2007
Posts: 5,210
Ä°stanbul, Turkey
|
in that case are you sure it's 16x16 and not 16x17 or 16x15 ?
3333333333
|
|
|
Moderated by mk_1, Perro, rayp, Realspawn, Rei_Ayanami, rvL_eXile, Spirit, Superku, Tobias, TSG_Torsten, VeT
|