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"
namespace SDLPP {
FontConfiguration::FontConfiguration( std::shared_ptr< Font > font, const std::string &color,
const std::string &outline_color, double outline_size ) {
FontConfiguration::FontConfiguration( std::shared_ptr< Font > font,
const std::string &color,
const std::string &outline_color,
double outline_size ) {
_font = font;
_color = color;
_outline_color = outline_color;
@ -32,4 +34,4 @@ void FontConfiguration::setColor( const std::string &color ) {
void FontConfiguration::setOutlineColor( const std::string &outline_color ) {
_outline_color = outline_color;
}
}
} // namespace SDLPP

View File

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

View File

@ -14,7 +14,7 @@ public:
Renderer( Window &window );
virtual ~Renderer();
SDL_Renderer *getRendererPtr();
Vec2D<int> getDimensions() const;
Vec2D< int > getDimensions() const;
int getWidth() const;
int getHeight() const;
int getSmallerSide() const;

View File

@ -163,7 +163,7 @@ const std::shared_ptr< RenderObject > &Scene::leftmost() {
const std::shared_ptr< RenderObject > &Scene::rightmost() {
return rightmost_obj;
}
Vec2D<int> Scene::getDimensions() const {
Vec2D< int > Scene::getDimensions() const {
return renderer->getDimensions();
}
int Scene::getWidth() const {