Window snapping

Forum for technical discussions regarding development. If you have a general suggestion, problem or comment, please use one of the other forums.

Moderator: OpenTTD Developers

Post Reply
nzhook
Engineer
Engineer
Posts: 115
Joined: 02 Jul 2004 13:15
Location: NZ
Contact:

Window snapping

Post by nzhook »

G'Day, people. Ive finnaly had some limited time to sit down and look at the oTTD code and thought that I would attempt something semi-simple. (although in the end it turned out to be a little more thought required)

Attached should be a patch against SVN revision 532 for adding basic support for window snapping. eg. you can move one window next to another and it will snap to the edge of the existing window. This is good for aligning the windows in a toolbar effect without having to attempt to get it down to each indvidual pixel.

Before I post it to SF I would like some people to test it and give me any ideas/thoughts/bugs. (including comments on how to fix the rather largish code in order to do it)

Some notes:
* There are some edges it dosnt snap with,
* Right edges of both windows going right.
* Bottom edges going down
* The snapping is done based on the corners (not the border) if someone can think of a way to do the whole border effectivly please let me know


Hope it prooves usfull to someone besides me...
Attachments
windowsnaps.patch
The patch, sorry I run Debian linux so no Windows EXE
(4.59 KiB) Downloaded 302 times
nzhook
Engineer
Engineer
Posts: 115
Joined: 02 Jul 2004 13:15
Location: NZ
Contact:

Post by nzhook »

Cant have been that bad, tron (aka detron) applied a version to SVN. (r538) however it does miss a couple of the additional snapping features mine included for aligning the windows. So ive made an additional patch against r538 with these in it.

https://sourceforge.net/tracker/index.p ... tid=636367

Im still waiting for some critisim to the patch however. (eg. thoughts or suggestions (eg. should it allow to snap the moving windows right border to the others right border... I havnt done this as I dont think its used or at least would be to difficul to manage)

Edit: maybe this topic should be moved to the General OpenTTD now? (mods?)
Moriarty
Tycoon
Tycoon
Posts: 1395
Joined: 12 Jun 2004 00:37
Location: United Kingdom of Great Britain and Northern Ireland
Contact:

Post by Moriarty »

I think only the devs and a few others can test out patches (us mere-mortals can't apply patches. all that recompiling tripe. give me a scripting language any day. ;) )
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 37 guests