Rectangle.Inflate

G

Guest

Hi,

Why no inverse of this method? We can inflate but not deflate or shrink?


Thanks.
 
J

Justin Weinberg

Inflate is just a convenience method. You can always create a new
rectangle. I think the reason it's included is to simplify hit testing.
 
B

Byron Cullen

Use negative numbers for the inflate values to deflate the rectangle.

Byron Cullen
ThunderTools
 
A

Alvin Bruney

Then maybe its a bad name for a method. it should be rescale() or something.
 
1

100

Hi,
Then maybe its a bad name for a method. it should be rescale() or
something.
Maybe, but it changes the size and location of the rectangle. Thus, names as
rescale or resize are not completely correct as well, I think.

B\rgds
100
 
A

Alvin Bruney

Transform() then
100 said:
Hi,
something.
Maybe, but it changes the size and location of the rectangle. Thus, names as
rescale or resize are not completely correct as well, I think.

B\rgds
100
 
H

Herfried K. Wagner [MVP]

* "100 said:
Maybe, but it changes the size and location of the rectangle. Thus, names as
rescale or resize are not completely correct as well, I think.

Mhm... Scaling changes the position too, doesn't it? It depends on what
is scaled, I know.
 
1

100

Herfried K. Wagner said:
Mhm... Scaling changes the position too, doesn't it? It depends on what
is scaled, I know.

Maybe. I will expect to specify percentage of scaling, though.
rect.Scale(150) or rect.Scale(1.5)

I don't know. I think Inflate is OK. I kind of believe that having a
complementary Deflate or Shirnk method is not as great ideia as it sounds .
Windows API doesn't have Deflate, MFC CRect has but Inflate and Deflate do
the same work the difference is in the sign of the parameters which we have
to use to get the same result I found it little bit confusing. So I believe
it's better to have only one method. I'm cool with that name. Method with
the same name that do the same kind of work can be found in almost any
framework or graphics library.

B\rgds
100
 
H

Herfried K. Wagner [MVP]

* "Alvin Bruney said:
Ok how about we name it after me :D

Alvin()

Do some research, write some papers about it and maybe the'll name it
after you.

;-)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top