@@ -63,10 +63,13 @@ void CWindow::setMouseData(SDL_MouseMotionEvent motion)
6363{
6464 // cursor is on the title frame (+/-2 and +/-4 are only for a good optic)
6565 const Position titleFrameLT =
66- pos_ + Position (global::getBitmapSize (ArchiveID::Resource, WINDOW_LEFT_UPPER_CORNER ).x , 0 ) + Position (2 , 4 );
66+ pos_ + Position (static_cast <int >(global::getBitmapSize (ArchiveID::Resource, WINDOW_LEFT_UPPER_CORNER ).x ), 0 )
67+ + Position (2 , 4 );
6768 const Position titleFrameRB =
68- pos_ + Position (static_cast <int >(size_.x ), global::getBitmapSize (ArchiveID::Resource, WINDOW_UPPER_FRAME ).y )
69- - Position (global::getBitmapSize (ArchiveID::Resource, WINDOW_RIGHT_UPPER_CORNER ).x + 2 , 4 );
69+ pos_
70+ + Position (static_cast <int >(size_.x ),
71+ static_cast <int >(global::getBitmapSize (ArchiveID::Resource, WINDOW_UPPER_FRAME ).y ))
72+ - Position (static_cast <int >(global::getBitmapSize (ArchiveID::Resource, WINDOW_RIGHT_UPPER_CORNER ).x ) + 2 , 4 );
7073 if (IsPointInRect (motion.x , motion.y , Rect (titleFrameLT, Extent (titleFrameRB - titleFrameLT))))
7174 {
7275 // left button was pressed while moving
@@ -91,28 +94,29 @@ void CWindow::setMouseData(SDL_MouseMotionEvent motion)
9194 {
9295 // cursor is on the button (+/-2 is only for the optic)
9396 const auto closeSize = global::getBitmapSize (ArchiveID::Resource, WINDOW_BUTTON_CLOSE );
94- canClose_marked = IsPointInRect ( Position (motion. x , motion. y ),
95- Rect (pos_ + Position (2 , 2 ), Extent ( closeSize - Extent (4 , 4 ) )));
97+ canClose_marked =
98+ IsPointInRect ( Position (motion. x , motion. y ), Rect (pos_ + Position (2 , 2 ), closeSize - Extent (4 , 4 )));
9699 }
97100 // check whats happen to the minimize button
98101 if (canMinimize)
99102 {
100103 // cursor is on the button (+/-2 is only for the optic)
101104 const auto minSize = global::getBitmapSize (ArchiveID::Resource, WINDOW_BUTTON_MINIMIZE );
102- canMinimize_marked = IsPointInRect (
103- Position (motion.x , motion.y ),
104- Rect (pos_ + Position (static_cast <int >(size_.x ) - minSize.x + 2 , 2 ), Extent (minSize - Extent (4 , 4 ))));
105+ canMinimize_marked =
106+ IsPointInRect (Position (motion.x , motion.y ),
107+ Rect (pos_ + Position (static_cast <int >(size_.x ) - static_cast <int >(minSize.x ) + 2 , 2 ),
108+ minSize - Extent (4 , 4 )));
105109 }
106110 // check whats happen to the resize button
107111 if (canResize)
108112 {
109113 // cursor is on the button (+/-2 is only for the optic)
110114 const auto resizeSize = global::getBitmapSize (ArchiveID::Resource, WINDOW_BUTTON_RESIZE );
111- if (IsPointInRect (
112- Position (motion. x , motion. y ),
113- Rect (pos_ + Position (static_cast <int >(size_.x ) - resizeSize.x + 2 ,
114- static_cast <int >(size_.y ) - resizeSize.y + 2 ),
115- Extent ( resizeSize - Extent (4 , 4 ) ))))
115+ if (IsPointInRect (Position (motion. x , motion. y ),
116+ Rect (pos_
117+ + Position (static_cast <int >(size_.x ) - static_cast < int >( resizeSize.x ) + 2 ,
118+ static_cast <int >(size_.y ) - static_cast < int >( resizeSize.y ) + 2 ),
119+ resizeSize - Extent (4 , 4 ))))
116120 {
117121 // left button was pressed while moving
118122 if (SDL_GetMouseState (nullptr , nullptr ) & SDL_BUTTON (SDL_BUTTON_LEFT ))
0 commit comments