New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Editor: enhance coordinates hint when moving Objects and Characters around the room #2229
Editor: enhance coordinates hint when moving Objects and Characters around the room #2229
Conversation
I think I would collect the code that draws it around like here:
And then make an alternative to System.Drawing graphics DrawString that puts an outline around it - like say a black outline around the yellow text. I looked around and there isn't an easy way to do this, so it would require some amount of fiddling. But if this is acceptable approach l can figure somewhere to add a utility method for this and then PR this change later. |
I just added a black shade under whole text for now. |
8428658
to
9b52e64
Compare
Allow to drag objects beyond the room bounds.
9b52e64
to
491d420
Compare
using_keyboard_keys.mp4The PR does what it says. I noticed when tapping keys that the coordinate is only briefly shown, not sure if this is an issue or not. |
Yes, that's a problem, because with mouse user may keep button down and have the hint for as long as necessary, but with keys you cannot do that. So this solution does not work. Options:
|
From the options above
It appears this is the simplest rule. Maybe just making a function for the drawing of the coordinates and then when drawing the selection rectangle it would just call such function. |
All this is already in the same function, everything is drawn in OnPaint event. |
I think it's best to merge this PR as is. I played a bit with the mentioned alternatives and the "hide hint by a timer" is actually the one that felt best but there isn't a way to make the code for this super short, so this is best left to test it out later, probably after #2230 . |
I think i will ask on forums for more opinions. From the code's perspective the easiest is to draw coordinates always (while the object is selected). But I don't know if people will be okay with that. The way it works right now won't let to find coordinates comfortably enough with key moving, which will defeat the purpose of pr. |
if the zoom is one that makes the room really small, the coordinates occupy all of the room, and it's not possible to see what is selected, but by using the timer approach it's still useable. By showing when the object is selected, it becomes weird in this specific edge case, but the timer approach works alright. |
* Timer starts when user releases all moving keys. * Timer stops whenever an object begins to move again. * Hint state is cleared whenever selection changes or room filter looses focus.
Okay, I added the timer to remove the hint. It ended up with pretty small amount of code. |
I tested and the timer works great!!! This is a nice addition! Nudging with the arrow keys works nicely now, no more flickering when tapping the keys. :) |
Fix #984, addresses a minor problem mentioned in #614.
On a side note, the coordinates may be difficult to see sometimes, depending on background.
For a moment I've been thinking about letting user choose a color in Editor prefs, but even a custom color will still be fixed and have same problem. So this is an open issue.
EDIT: added a black shade under the text.
There is ALOT of code duplication in these two classes, so I opened #2230 as a separate task, don't have spare time for that right now.