mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2024-12-22 09:39:43 +01:00
Remove unnecessary calls to resize()
Just a small optimization. For example, consider the calls in adjust(). After the first resize(), the lines after only change the x-position and y-position of the text box and depend on the x-position, y-position, width, and height. However, resize() only changes the width and height if the contents of the text box change, which after the first call, they don't. So remove the second call to resize(), because it's completely unnecessary. By similar reasoning, the second calls to resize() in centerx() and centery() are unnecessary too.
This commit is contained in:
parent
28df0148b1
commit
82150fd3a9
1 changed files with 0 additions and 3 deletions
|
@ -66,13 +66,11 @@ void textboxclass::centerx(void)
|
||||||
{
|
{
|
||||||
resize();
|
resize();
|
||||||
xp = 160 - (w / 2);
|
xp = 160 - (w / 2);
|
||||||
resize();
|
|
||||||
}
|
}
|
||||||
void textboxclass::centery(void)
|
void textboxclass::centery(void)
|
||||||
{
|
{
|
||||||
resize();
|
resize();
|
||||||
yp = 120 - (h / 2);
|
yp = 120 - (h / 2);
|
||||||
resize();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void textboxclass::applyposition(void)
|
void textboxclass::applyposition(void)
|
||||||
|
@ -100,7 +98,6 @@ void textboxclass::adjust(void)
|
||||||
if (yp < 10) yp = 10;
|
if (yp < 10) yp = 10;
|
||||||
if (xp + w > 310) xp = 310 - w;
|
if (xp + w > 310) xp = 310 - w;
|
||||||
if (yp + h > 230) yp = 230 - h;
|
if (yp + h > 230) yp = 230 - h;
|
||||||
resize();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void textboxclass::initcol(int rr, int gg, int bb)
|
void textboxclass::initcol(int rr, int gg, int bb)
|
||||||
|
|
Loading…
Reference in a new issue