From 33cd5566909ac089cdf56db38a3d1daf0cb7dd10 Mon Sep 17 00:00:00 2001 From: heavydemon21 Date: Mon, 9 Dec 2024 15:35:36 +0100 Subject: fixed the aspect ratio and removed the ratio from sprite and give it to texture. however the problem still lies with if animator is given the aspect ratio is then off --- src/crepe/api/Sprite.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'src/crepe/api/Sprite.cpp') diff --git a/src/crepe/api/Sprite.cpp b/src/crepe/api/Sprite.cpp index 4cf214c..ba684ba 100644 --- a/src/crepe/api/Sprite.cpp +++ b/src/crepe/api/Sprite.cpp @@ -10,16 +10,12 @@ using namespace std; using namespace crepe; -Sprite::Sprite(game_object_id_t id, const Asset & texture, const ivec2 & size, const Sprite::Data & data) +Sprite::Sprite(game_object_id_t id, const Asset & texture, const Sprite::Data & data) : Component(id), source(texture), data(data) { dbg_trace(); - - this->mask.w = size.x; - this->mask.h = size.y; - this->aspect_ratio = static_cast(this->mask.w) / this->mask.h; } Sprite::~Sprite() { dbg_trace(); } -- cgit v1.2.3