Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Need Smooth Scrolling Help
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  7 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
jonathan doklovic  
View profile  
 More options Jul 1, 10:28 am
From: jonathan doklovic <mn...@sysbliss.com>
Date: Wed, 01 Jul 2009 09:28:04 -0500
Local: Wed, Jul 1 2009 10:28 am
Subject: Need Smooth Scrolling Help
Hey,

I'm working on a project where user's can drop things on to a canvas and
then drag them around.
The canvas is inside of another canvas. The parent is used as the
visible area and scrolls.
The child by default is bigger than the parent so scrollbars are always
present.

When the user drags an object outside of the visible area, I want the
parent canvas to scroll. (pretty easy).
Here's where it gets complex....  when the users drags an object past
the width/height of the child canvas, I want the child canvas to expand
and scroll as the user moves the object.  Also, if the user then moves
the object less than the default bounds, i want the child canvas to
shrink back up and scroll.

If any of you have ever used MagicDraw (the diagramming tool) this is
how it works when editing a diagram.

I actually have all of this working now, but when you drag past the
visible area, the scrolling happens WAY too fast and it's really hard to
control.

I was hoping to find some solution that would let me slow down the
scrolling and make it more smooth.

Anyone?

- Jonathan


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Dustin Tauer  
View profile  
 More options Jul 1, 10:41 am
From: "Dustin Tauer" <Dus...@easelsolutions.com>
Date: Wed, 1 Jul 2009 09:41:46 -0500
Local: Wed, Jul 1 2009 10:41 am
Subject: RE: [mnswf] Need Smooth Scrolling Help
The first thing I thought of was an easing function for the scrolling.
It's probably something you already experimented with, but I thought I'd
suggest it.

When your dragging you're probably using a ENTER_FRAME or MOUSE_MOVE
style event to adjust the scrolling.  So instead of scrolling directly
to where it needs to be:  

parent.scrollV = newValue

...you'd want to ease it:

parent.scrollV = newValue/2 (or a larger number for more lag)

D

Dustin Tauer
V.P Training & Development
Easel Solutions, Inc.
23 Empire Drive
St. Paul, MN 55116
p. 651-602-5654 | f. 651-602-3154
http://www.easelsolutions.com


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
jonathan doklovic  
View profile  
 More options Jul 1, 10:59 am
From: jonathan doklovic <mn...@sysbliss.com>
Date: Wed, 01 Jul 2009 09:59:51 -0500
Local: Wed, Jul 1 2009 10:59 am
Subject: Re: [mnswf] Re: Need Smooth Scrolling Help
I believe scrollV is only a property for textfields.
I'm using canvases and so I'm controlling the scrolling currently via
parent.horizontalScrollPosition

- J


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Dustin Tauer  
View profile  
 More options Jul 1, 11:06 am
From: "Dustin Tauer" <Dus...@easelsolutions.com>
Date: Wed, 1 Jul 2009 10:06:23 -0500
Local: Wed, Jul 1 2009 11:06 am
Subject: RE: [mnswf] Re: Need Smooth Scrolling Help
Ha...my bad.  I was recklessly pseudo coding ;)

So would easing the horizontalScrollPosition work?

Dustin Tauer
V.P Training & Development
Easel Solutions, Inc.
23 Empire Drive
St. Paul, MN 55116
p. 651-602-5654 | f. 651-602-3154
http://www.easelsolutions.com


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
jonathan doklovic  
View profile  
 More options Jul 1, 11:23 am
From: jonathan doklovic <mn...@sysbliss.com>
Date: Wed, 01 Jul 2009 10:23:26 -0500
Local: Wed, Jul 1 2009 11:23 am
Subject: Re: [mnswf] Re: Need Smooth Scrolling Help
It might help, but there's more to it....

When the child canvas resizes due to moving an object out of the bounds,
the parent adjusts it's scrollbars automatically due to the fact that
I'm required to have autolayout=true.  But when the object moves out of
the visible area, it's also telling the parent to scroll to it's
position so that it's within the visible area all the time.

I think that when the child canvas resizes, both scroll events are
happening which drives the thing crazy.  problem is, I don't know how to
solve this since there are cases when an object moves and needs
scrolling to happen but the child has not resized.

- Jonathan


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
CT Yeung  
View profile  
 More options Jul 1, 9:41 pm
From: CT Yeung <yeu...@gmail.com>
Date: Wed, 1 Jul 2009 20:41:38 -0500
Local: Wed, Jul 1 2009 9:41 pm
Subject: Re: [mnswf] Re: Need Smooth Scrolling Help
I have build a feature that involves zoom and pan which resulted
windowing a small portion like you just mentioned.
In my case, I offer a panning tool but I think you might want to rid
the default scrollbars and add your custom scrollbar (so you can
update and manipulate).

To keep all the numbers straight I placed a "Resize" and "Move" effect
in parallel pointing at a common target UIComponent.
Then whenever a user zoom or pan, I keep track of the position and
magnification to update my slider (your scrollbar) according.

For windowing, use a canvas of desirable dimension as mask.

CT


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Nicholas  
View profile  
 More options Jul 2, 10:47 am
From: Nicholas <nbi...@gmail.com>
Date: Thu, 2 Jul 2009 07:47:56 -0700 (PDT)
Local: Thurs, Jul 2 2009 10:47 am
Subject: Re: Need Smooth Scrolling Help
Create your velocity properties for movement and expansion, then add a
dampening to them.
So:

if (dragX > 0.8 * width) {
   someVelocity += 10;  // Have the velocity increase by a constant,
not percent-based

}

someVelocity *= .9;  // Add dampening so you don't get out of control.

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google