#include "rectangle.hpp" #include "math/transforms.hpp" #include "contexts/drawing_context.hpp" void primitives::Rectangle::Translate(const math::Vector& offset) { m_pos += offset; } void primitives::Rectangle::Rotate(const math::Vector& center, float angle) { m_pos = math::RotatePoint(center, angle, m_pos); m_angle = math::RotateAngle(m_angle, angle); } void primitives::Rectangle::Scale(const math::Vector& center, float factor) { m_pos = math::ScalePoint(center, factor, m_pos); m_size *= factor; } void primitives::Rectangle::Draw(DrawingContext& ctx) { ctx.DrawRectangle(m_pos, m_size, m_angle); }