mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-19 22:00:28 +01:00
[Kandinsky] Inline very simple operations on KDPoint and KDSize
Change-Id: I35f6bc9450b35b1ab7a0dcadce69dddf932dd23f
This commit is contained in:
@@ -12,7 +12,6 @@ objs += $(addprefix kandinsky/src/,\
|
||||
ion_context.o\
|
||||
point.o\
|
||||
rect.o\
|
||||
size.o\
|
||||
text.o\
|
||||
)
|
||||
tests += $(addprefix kandinsky/test/,\
|
||||
|
||||
@@ -3,11 +3,12 @@
|
||||
|
||||
#include <kandinsky/coordinate.h>
|
||||
|
||||
struct KDPoint {
|
||||
class KDPoint {
|
||||
public:
|
||||
constexpr KDPoint(KDCoordinate x, KDCoordinate y) :
|
||||
m_x(x), m_y(y) {}
|
||||
KDCoordinate x() const;
|
||||
KDCoordinate y() const;
|
||||
KDCoordinate x() const { return m_x; }
|
||||
KDCoordinate y() const { return m_y; }
|
||||
KDPoint translatedBy(KDPoint other) const;
|
||||
KDPoint opposite() const;
|
||||
private:
|
||||
|
||||
@@ -3,11 +3,12 @@
|
||||
|
||||
#include <kandinsky/coordinate.h>
|
||||
|
||||
struct KDSize {
|
||||
class KDSize {
|
||||
public:
|
||||
constexpr KDSize(KDCoordinate width, KDCoordinate height) :
|
||||
m_width(width), m_height(height) {}
|
||||
KDCoordinate width() const;
|
||||
KDCoordinate height() const;
|
||||
KDCoordinate width() const { return m_width; }
|
||||
KDCoordinate height() const { return m_height; }
|
||||
private:
|
||||
KDCoordinate m_width;
|
||||
KDCoordinate m_height;
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
#include <kandinsky/point.h>
|
||||
|
||||
KDCoordinate KDPoint::x() const { return m_x; }
|
||||
KDCoordinate KDPoint::y() const { return m_y; }
|
||||
|
||||
KDPoint KDPoint::translatedBy(KDPoint other) const {
|
||||
return KDPoint(m_x+other.x(), m_y+other.y());
|
||||
}
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
#include <kandinsky/size.h>
|
||||
|
||||
KDCoordinate KDSize::width() const { return m_width; }
|
||||
KDCoordinate KDSize::height() const { return m_height; }
|
||||
Reference in New Issue
Block a user