Placing empty space in editor with mouse wheel

Found a bug in R'n'D? Report it here!

Moderators: Flumminator, Zomis

Post Reply
Tomi
Posts: 339
Joined: Wed Aug 03, 2005 3:37 pm
Location: Slovakia

Placing empty space in editor with mouse wheel

Post by Tomi »

(I use SDL.) When you move mouse wheel in editor, it places empty space. I think that placing the middle button element would be more logical. It seems that moving mouse wheel = pressing a button with some weird button code.

Code: Select all

(editor.c line 2496)
#define BUTTON_ELEMENT(button) ((button) == 1 ? new_element1 : \
                                (button) == 2 ? new_element2 : \
                                (button) == 3 ? new_element3 : EL_EMPTY)
User avatar
Holger
Site Admin
Posts: 4081
Joined: Fri Jun 18, 2004 4:13 pm
Location: Germany
Contact:

Post by Holger »

> When you move mouse wheel in editor, it places empty space.

Urgs. Indeed... :-o

> I think that placing the middle button element would be more logical.

Well, I think that doing nothing would be the best! (Or to scroll the element list, or vertically scrolling the level area, or something like that...)

> It seems that moving mouse wheel = pressing a button with some weird
> button code.

Yep, that's what I also suppose. Unfortunately, I do not use a wheel mouse, so I never noticed that bug! :-(

I think that a lot of other areas are also affected by this bug, where I simply check for "is any button pressed" (over checkboxes, for example), and where I should only allow the first or the first three mouse buttons... :-/

I should check all this at a system with a wheel mouse, and should fix some things. In the editor, I have explicitly fixed it where I thought it could happen, but wasn't able to test the result yet.

In any case, thanks a lot for reporting this issue.
User avatar
RAP
Posts: 317
Joined: Sat Jun 19, 2004 6:44 pm

This so called Mouse Bug...

Post by RAP »

Well, I used to have a mouse with a wheel mouse and it works fine on
buttons, editors and others... :)

Whoops! I almost forgot! When you use the mouse wheel, click one of the
level scoll numbers and it srcolls 5 levels at a time, depending where did
you go level to level...

So Tomi, why did you post the bug?
Tomi
Posts: 339
Joined: Wed Aug 03, 2005 3:37 pm
Location: Slovakia

Post by Tomi »

> ...it srcolls 5 levels at a time, depending where did you go level to level...
> So Tomi, why did you post the bug?
The problem isn't when you *press* the wheel (which works as middle button just as expected), but when you *scroll* it - it places empty space to the square you're pointing on.
btw: When I tried to understand your post I've tried it on the level counter and found out that it, of course, fails even with counters:

Code: Select all

(editor.c few lines below)
#define BUTTON_STEPSIZE(button) ((button) == 1 ? 1 : (button) == 2 ? 5 : 10)
So scrolling the wheel when on a counter button adds/substracts 10 from the value.

Only "infected" files should be editor.*, libgame/gadgets.*, maybe events.* and similar.
Post Reply