[PD-dev] improved scrolling algorithm

Hans-Christoph Steiner hans at at.or.at
Thu Jun 10 03:56:05 CEST 2010


I briefly checked this out and it looks like a substantial effort that  
we should get merged in.  But I think its too large to merge into Pd- 
extended 0.42.5 at this stage of the release cycle.  I believe I  
mentioned before that working with this GUI code was a dead end since  
0.43 includes the new GUI code.

This stuff should be adapted to the code in pd-gui-rewrite/0.43  
branch.  If it gets included there, it'll then make it into Pd vanilla  
and Pd-extended.

.hc

On May 19, 2010, at 3:04 PM, Ivica Ico Bukvic wrote:

> OK, here's a complete patch that fixes most (all?) issues with  
> scrolling
> algorithm listed below.
>
> Please note the following applies to:
> Linux/OSX/Windows
> Pd 0.42.5 vanilla and extended
> Tcl/Tk 8.4 & 8.5
>
> In addition to the detailed description provided in the previous  
> email,
> here's a list of fixes:
>
> *redesigned scrolling algorithm so that is no 0 0 centric but rather
> viewport-centric (e.g. if everything can fit within the said window,  
> it
> should)
>
> *100% accurate bbox creation including text which requires font  
> resizing
> workaround (known tcl/tk issue). Font resizing has to be done per-font
> (Linux fix provided for three default fonts, currently other OSs use  
> old
> bbox style even though it is broken mainly because its fonts need to  
> be
> manually re-calibrated). Font resizing has been tested accurate up to
> 1000px-sized fonts but should work beyond as well. NB: this has been
> mainly tested with 8.5 with antialiased fonts on Linux but should work
> on other versions as well. The text also avoids calculating bbox for
> text entries that are empty (something that existing version does  
> making
> its bbox incorrect and rendering GUI creation with tight window  
> margins
> impossible, e.g. a large number2 object with a window size matching
> object's)
>
> *scroll wheel scrolls only if the scrollbars are active (back-ported
> from pd-extended)
>
> *scrollbars update automatically and dynamically with
> undo/redo/cut/paste/resize/typing text, as well as apply actions in
> canvas and object properties where the change may require creation or
> hiding of scrollbars (e.g. creating an atom and then in its properties
> applying width of 1000 which then spills outside the visible window  
> will
> automatically update scrollbars).
>
> *array and graph are spawned always on-screen regardless how big patch
> is or how far it is currently located away from the 0 0 origin.
>
> *array name is immediately displayed at creation-time rather than
> requiring moving the object before it is properly displayed.
>
> *properties windows spawn right next to the mouse which makes  
> editing a
> lot easier rather than hunting the widget across the random desktop
> spawning locations.
>
> Now I think this should pass all Hans's pd-gui-rewrite tests plus
> provide a few more test cases none of the existing models account for.
>
> Attached tarball consists of 15 separate patches (named after the file
> they are meant to patch) and should patch cleanly against 0.42.5
> pd-extended source. Changes should be also mostly self-explanatory or
> are commented accordingly.
>
> Cheers!
>
> ico
> <bigkahuna_100519.tar.gz>




----------------------------------------------------------------------------

You can't steal a gift. Bird gave the world his music, and if you can  
hear it, you can have it. - Dizzy Gillespie






More information about the Pd-dev mailing list