For me, dragging is pretty snappy once the cache has been created.
However, that doesn't happen till you actually move the window (ie.
after 5 pixels or so of mouse movement while holding down).
Did a small experiment moving cache updating to mouseUp/Down events
instead, felt snappier to me at least.
Bad thing is, I had to introduce things like:
- A setter for the cache.
- Direct manipulation of hand in SystemWindow mouseDown (at least I
didn't cross that boundry first :) )
Attached a changeset (based on 243core with PolyMorph-Widgets-gvc.52
merged in)
you can try, and merge in if you feel the gain worth the nastiness.
Otherwise feel free to reimplement in a better way :)
Cheers,
Henry
Gary Chambers skrev:
Latest Polymorph has theme-handled drop shadow support when carried by hand.
Doesn't help grabbing faster since for the cached form it needs to draw the
window on the cached form and also redraw the world without the window as a
submorph. Dragging more complex windows will always be slower to initially
respond, unfortunately.
Regards, Gary
----- Original Message -----
From: "Alexandre Bergel" <[email protected]>
To: <[email protected]>; <[email protected]>
Sent: Sunday, February 22, 2009 1:51 PM
Subject: Re: [Pharo-project] Shadow in Watery2
If this would help grabbing and dragging windows faster, I would use it.
Alexandre
On 22 Feb 2009, at 14:43, Rob Rothwell wrote:
For that, I would ask "is it worth it?" How many users are just
going to turn on the fastDragWindowForMorphic preference anyway?!
For some reason that little delay when you grab a window to move it
always prompts me to do so!
Just my thought on the matter...
Take care,
Rob
On Sun, Feb 22, 2009 at 7:10 AM, Gary Chambers <[email protected]
wrote:
Yeah, the ordinary drop shadow was quite simple to implement.
Hand-grabbed drop shadows are altogether much nastier!
Not impossible but would require some evil hacking.
Regards, Gary
----- Original Message -----
From: "Igor Stasenko" <[email protected]>
To: <[email protected]>
Sent: Saturday, February 21, 2009 1:58 PM
Subject: Re: [Pharo-project] Shadow in Watery2
2009/2/21 Marcus Denker <[email protected]>:
Gary,
Watery2 looks better and better :-) Great!
One question regarding the shadow: Now the active window has
a translucent shadow (like macos), very nice.
But it's turned off and replaced with the hard non-translucend
Morphic shadow while moving the window.
Would it be possible to render the same shadow, even wen picking
up windows? This would result in a much smoother apperance, and I
think it even would feel faster.
Good luck with that.. For shadow when picking up responds the hand
morph..
There is quite sophisticated logic which caching the morph
appearance
when its in hand.. along with shadow.
I tried to reproduce this effect on my GLCanvas, but found it
impossible to do without support of render buffers extension :)
Marcus
--
Marcus Denker -- [email protected]
http://www.marcusdenker.de
_______________________________________________
Pharo-project mailing list
[email protected]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
--
Best regards,
Igor Stasenko AKA sig.
_______________________________________________
Pharo-project mailing list
[email protected]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________
Pharo-project mailing list
[email protected]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________
Pharo-project mailing list
[email protected]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
_______________________________________________
Pharo-project mailing list
[email protected]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________
Pharo-project mailing list
[email protected]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
'From Pharo0.1 of 16 May 2008 [Latest update: #10243] on 24 February 2009 at
8:04:22 pm'!
!HandMorph methodsFor: 'drawing' stamp: 'Henrik Sperre Johansen 2/24/2009
18:25'!
cacheCanvas: aCanvas
cacheCanvas := aCanvas! !
!HandMorph methodsFor: 'drawing' stamp: 'Henrik Sperre Johansen 2/24/2009
20:03'!
updateCacheCanvas: aCanvas
"Update the cached image of the morphs being held by this hand."
"Note: The following is an attempt to quickly get out if there's no
change"
| subBnds rectList nPix |
subBnds := Rectangle merging: (submorphs collect: [:m | m fullBounds]).
rectList := damageRecorder invalidRectsFullBounds: subBnds.
damageRecorder reset.
(rectList isEmpty
and: [cacheCanvas notNil and: [cacheCanvas extent = subBnds
extent]])
ifTrue: [^self].
"Always check for real translucency -- can't be cached in a form"
self submorphsDo:
[:m |
m wantsToBeCachedByHand
ifFalse:
[cacheCanvas := nil.
cachedCanvasHasHoles := true.
^self]].
(cacheCanvas extent ~= subBnds extent)
ifTrue:
[cacheCanvas translateBy: subBnds origin negated
during: [:tempCanvas | self drawSubmorphsOn:
tempCanvas].
self submorphsDo:
[:m |
(m areasRemainingToFill: subBnds)
isEmpty
ifTrue: [^cachedCanvasHasHoles
:= false]].
nPix := cacheCanvas form tallyPixelValues first.
"--> begin rounded corners hack <---"
cachedCanvasHasHoles := (nPix = 48
and: [submorphs size = 1 and:
[submorphs first wantsRoundedCorners]])
ifTrue: [false]
ifFalse: [nPix > 0].
"--> end rounded corners hack <---"
^self].
"incrementally update the cache canvas"
cacheCanvas translateBy: subBnds origin negated
during:
[:cc |
rectList do:
[:r |
cc clipBy: r
during:
[:c |
c fillColor: Color
transparent.
self drawSubmorphsOn:
c]]]! !
!SystemWindow methodsFor: 'events' stamp: 'Henrik Sperre Johansen 2/24/2009
18:43'!
mouseUp: evt
| cp |
evt hand resourceJustLoaded.
model windowActiveOnFirstClick ifTrue:
["Normally window takes control on first click.
Need explicit transmission for first-click activity."
cp _ evt cursorPoint.
submorphs do: [:m | (m containsPoint: cp) ifTrue: [m mouseUp:
evt]]]! !
_______________________________________________
Pharo-project mailing list
[email protected]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project