SDLPP: Formatting

This commit is contained in:
zvon 2021-03-15 14:50:40 +01:00
parent 4cd351c7a3
commit 6cfe2046d4
4 changed files with 16 additions and 5 deletions

View File

@ -1,8 +1,10 @@
#include "sdlpp_fontconfiguration.hpp" #include "sdlpp_fontconfiguration.hpp"
namespace SDLPP { namespace SDLPP {
FontConfiguration::FontConfiguration( std::shared_ptr< Font > font, const std::string &color, FontConfiguration::FontConfiguration( std::shared_ptr< Font > font,
const std::string &outline_color, double outline_size ) { const std::string &color,
const std::string &outline_color,
double outline_size ) {
_font = font; _font = font;
_color = color; _color = color;
_outline_color = outline_color; _outline_color = outline_color;
@ -32,4 +34,4 @@ void FontConfiguration::setColor( const std::string &color ) {
void FontConfiguration::setOutlineColor( const std::string &outline_color ) { void FontConfiguration::setOutlineColor( const std::string &outline_color ) {
_outline_color = outline_color; _outline_color = outline_color;
} }
} } // namespace SDLPP

View File

@ -28,6 +28,7 @@ public:
updateMost(); updateMost();
return *this; return *this;
} }
void updateMost() { void updateMost() {
if ( _start.getY() < _end.getY() ) { if ( _start.getY() < _end.getY() ) {
top = &_start; top = &_start;
@ -44,28 +45,36 @@ public:
right = &_start; right = &_start;
} }
} }
const Vec2D< T > &getStart() const { const Vec2D< T > &getStart() const {
return _start; return _start;
} }
const Vec2D< T > &getEnd() const { const Vec2D< T > &getEnd() const {
return _end; return _end;
} }
double length() const { double length() const {
return vecDistance( _start, _end ); return vecDistance( _start, _end );
} }
double lengthSquared() const { double lengthSquared() const {
return vecDistanceSquared( _start, _end ); return vecDistanceSquared( _start, _end );
} }
void setInfinite( bool infinite ) { void setInfinite( bool infinite ) {
_infinite = infinite; _infinite = infinite;
} }
bool isInfinite() { bool isInfinite() {
return _infinite; return _infinite;
} }
void add( const Vec2D< T > &vec ) { void add( const Vec2D< T > &vec ) {
_start += vec; _start += vec;
_end += vec; _end += vec;
} }
const Vec2D< T > &topmost() const { const Vec2D< T > &topmost() const {
return *top; return *top;
} }