I see a bug. Did right-button dragging ever work?

Discussion of all aspects of the game engine, including development of new and existing features.

Moderators: Developers, Forum Moderators

I see a bug. Did right-button dragging ever work?

Postby singalen » March 19th, 2017, 7:15 pm

I think I see an error which breaks dragging.

In mouse_handler_base.cpp around line 118:
(SDL_GetMouseState(&mx,&my) & SDL_BUTTON_LEFT) != 0
SDL_GetMouseState() returns the state of ALL buttons, it's a bit mask. SDL_BUTTON_LEFT is the button ID.
I'm sure this should be
(SDL_GetMouseState(&mx,&my) & SDL_BUTTON(SDL_BUTTON_LEFT)) != 0
because SDL_BUTTON() turns button ID into a respective bit in a bit status field.

It only works for SDL_BUTTON_LEFT because SDL_BUTTON(SDL_BUTTON_LEFT) == 1 and SDL_BUTTON_LEFT == 1.

Did right-button dragging ever work? Looks like there was supposed to be left-button and right-button dragging, but now right click invokes a context menu immediately.
Was it supposed to drag a map? I would be pretty happy to use a map dragging functionality in a touch UI.
User avatar
singalen
Translator
 
Posts: 109
Joined: January 3rd, 2007, 10:18 am
Location: dp.ua

Re: I see a bug. Did right-button dragging ever work?

Postby singalen » March 20th, 2017, 1:47 am

Edit: I found the commit that added the hint of right-dragging: https://github.com/wesnoth/wesnoth/comm ... 815c1dfbee
Right-dragging never existed in the first place. Maybe it's time for it!
User avatar
singalen
Translator
 
Posts: 109
Joined: January 3rd, 2007, 10:18 am
Location: dp.ua


Return to Coder’s Corner

Who is online

Users browsing this forum: No registered users and 2 guests