File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -226,6 +226,11 @@ bool Sprite::dragging() const
226226void Sprite::startDragging ()
227227{
228228 impl->dragging = true ;
229+
230+ IEngine *eng = engine ();
231+
232+ if (eng)
233+ eng->moveSpriteToFront (this );
229234}
230235
231236/* ! Stops dragging. */
Original file line number Diff line number Diff line change @@ -400,6 +400,12 @@ TEST(SpriteTest, Dragging)
400400 sprite.setInterface (&handler);
401401 ASSERT_FALSE (sprite.dragging ());
402402
403+ EngineMock engine;
404+ sprite.setEngine (&engine);
405+ EXPECT_CALL (engine, spriteFencingEnabled).WillRepeatedly (Return (false ));
406+ EXPECT_CALL (engine, requestRedraw).WillRepeatedly (Return ());
407+
408+ EXPECT_CALL (engine, moveSpriteToFront (&sprite));
403409 sprite.startDragging ();
404410 ASSERT_TRUE (sprite.dragging ());
405411
You can’t perform that action at this time.
0 commit comments