@@ -59,8 +59,8 @@ void RenderedTarget::loadProperties()
5959
6060 // Coordinates
6161 double size = sprite->size () / 100 ;
62- m_x = m_engine->stageWidth () / 2 + sprite->x () - m_costume->rotationCenterX () * size / 2 * (m_newMirrorHorizontally ? -1 : 1 );
63- m_y = m_engine->stageHeight () / 2 - sprite->y () - m_costume->rotationCenterY () * size / 2 ;
62+ m_x = static_cast < double >( m_engine->stageWidth () ) / 2 + sprite->x () - m_costume->rotationCenterX () * size / 2 * (m_newMirrorHorizontally ? -1 : 1 );
63+ m_y = static_cast < double >( m_engine->stageHeight () ) / 2 - sprite->y () - m_costume->rotationCenterY () * size / 2 ;
6464 m_originX = m_costume->rotationCenterX () * size / 2.0 ;
6565 m_originY = m_costume->rotationCenterY () * size / 2.0 ;
6666
@@ -70,8 +70,8 @@ void RenderedTarget::loadProperties()
7070
7171 mutex.unlock ();
7272 } else if (m_stageModel) {
73- m_x = m_engine->stageWidth () / 2 - m_costume->rotationCenterX () / 2 ;
74- m_y = m_engine->stageHeight () / 2 - m_costume->rotationCenterY () / 2 ;
73+ m_x = static_cast < double >( m_engine->stageWidth ()) / 2 - m_costume->rotationCenterX () / 2.0 ;
74+ m_y = static_cast < double >( m_engine->stageHeight ()) / 2 - m_costume->rotationCenterY () / 2.0 ;
7575 m_originX = m_costume->rotationCenterX () / 2.0 ;
7676 m_originY = m_costume->rotationCenterY () / 2.0 ;
7777 }
@@ -189,6 +189,30 @@ Target *RenderedTarget::scratchTarget() const
189189 return nullptr ;
190190}
191191
192+ double RenderedTarget::costumeWidth () const
193+ {
194+ return m_width;
195+ }
196+
197+ void RenderedTarget::setCostumeWidth (double width)
198+ {
199+ mutex.lock ();
200+ m_width = width;
201+ mutex.unlock ();
202+ }
203+
204+ double RenderedTarget::costumeHeight () const
205+ {
206+ return m_height;
207+ }
208+
209+ void RenderedTarget::setCostumeHeight (double height)
210+ {
211+ mutex.lock ();
212+ m_height = height;
213+ mutex.unlock ();
214+ }
215+
192216unsigned char *RenderedTarget::svgBitmap () const
193217{
194218 return m_svgBitmap;
0 commit comments