34 #include <Pt/Gfx/Api.h>
51 Size(Float w, Float h)
56 : _w(other._w), _h(other._h)
65 void set(Float w, Float h)
73 return _w == 0 || _h == 0;
82 void setWidth(Float w)
85 void setHeight(Float h)
88 void setWidthHeight(Float w, Float h)
94 const Size& addWidth(Float w)
100 const Size& subWidth(Float w)
106 const Size& addHeight(Float h)
112 const Size& subHeight(Float h)
118 void add(
const Size& s)
138 bool operator==(
const Size& other)
const
140 return (_w == other._w && _h == other._h);
143 bool operator!=(
const Size& other)
const
145 return (_w != other._w || _h != other._h);
148 bool operator<(
const Size& other)
const
150 return _h < other._h || (_h == other._h && _w < other._w);
153 Size operator*(Float v)
const
155 return Size(_w * v, _h * v);
158 Size operator/(Float v)
const
160 return Size(_w / v, _h / v);
163 Size operator+(Float v)
const
165 return Size(_w + v, _h + v);
168 Size operator-(Float v)
const
170 return Size(_w - v, _h - v);
173 Size& operator*=(Float v)
180 Size& operator/=(Float v)
187 Size& operator+=(Float v)
194 Size& operator-=(Float v)
222 : _w(other._w), _h(other._h)
231 void set(Int w, Int h)
239 return _w == 0 || _h == 0;
251 void setHeight(Int h)
254 void setWidthHeight(Int w, Int h)
260 const SizeI& addWidth(Int w)
266 const SizeI& subWidth(Int w)
272 const SizeI& addHeight(Int h)
278 const SizeI& subHeight(Int h)
284 void add(
const SizeI& s)
304 bool operator==(
const SizeI& other)
const
306 return (_w == other._w && _h == other._h);
309 bool operator!=(
const SizeI& other)
const
311 return (_w != other._w || _h != other._h);
314 SizeI operator*(Int v)
const
316 return SizeI(_w * v, _h * v);
319 SizeI operator+(Int v)
const
321 return SizeI(_w + v, _h + v);
324 SizeI operator-(Int v)
const
326 return SizeI(_w - v, _h - v);
329 SizeI& operator*=(Int v)
336 SizeI& operator+=(Int v)
343 SizeI& operator-=(Int v)