Closed Bug 450816 Opened 16 years ago Closed 16 years ago

Use a larger canvas for panning

Categories

(Firefox for Android Graveyard :: Panning/Zooming, defect)

defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED
fennec1.0a1

People

(Reporter: pavlov, Assigned: Gavin)

References

Details

Attachments

(1 file, 1 obsolete file)

We should increase the size of our canvas to be larger than the visible area.

it would be great if it were floating, with default values such as:
3x height and maybe min(visible width, 150% * scroll width) (not sure if 50% width is enough, a good starting point, probably.)

So at (0,0) we might have something like:

----------------------------
|                          |
|                          |
|      visible area        |
|                          |
-------------------------------
|                             |
|                             |
|                             |
|                             |
|                             |
|                             |
|      hidden  area           |
|                             |
-------------------------------

or while scrolled:
---------------------------------
|                               |
|                               |
|        hidden  area           |
|                               |
---------------------------------
  |                          |
  |                          |
  |      visible area        |
  |                          |
---------------------------------
|                               |
|                               |
|        hidden  area           |
|                               |
---------------------------------
Flags: wanted-fennec1.0+
we should also benchmark if it is faster to paint all at once or paint in sections (visible first, hidden after)
Assignee: nobody → gavin.sharp
Depends on: 457326
Attached patch patch (obsolete) — Splinter Review
This is a simple approach, with the canvas twice the height of the content area (50% above and 50% below the viewport).

Could use some extra testing, but seems to work OK.
looks good at zoom=1, but has some problems when zoomed:
1. the initial double click to zoom doesn't redraw completely (pieces are left in view)
2. panning (mainly left and right) displays "junk" at the extremes

Both of these situations are cleaned up by the next redraw. In fact, #2 gets redrawn when the finger is lifted after the pan.
I'm seeing a number of odd things in addition to what finkle is seeing:  go to cnn.com and drag a small bit down and it often jumps nearly 50 pixels down.  i'm seeing a number of repainting problems as well, but not sure what is causing them...
I see the "jumps nearly 50 pixels down" issue too
Attached patch better patchSplinter Review
This should solve all of the problems with the previous patch mentioned above.
Attachment #342377 - Attachment is obsolete: true
Attachment #342472 - Flags: review?(pavlov)
Attachment #342472 - Flags: review?(mark.finkle)
Comment on attachment 342472 [details] [diff] [review]
better patch

Tested out ok for me. I see none of the problems I saw with the first patch.
Attachment #342472 - Flags: review?(mark.finkle) → review+
Attachment #342472 - Flags: review?(pavlov) → review+
http://hg.mozilla.org/mobile-browser/rev/3772037edcd8

some followup fodder:
-redraw hidden areas separately
-avoid redrawing the parts that don't change when ending a pan
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
verfied with beta3
Status: RESOLVED → VERIFIED
Component: General → Panning/Zooming
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: