Author Topic: ScrollPane fix?  (Read 985 times)

ismaelj

  • Newbie
  • *
  • Posts: 15
ScrollPane fix?
« on: March 16, 2010, 11:21:13 am »
When my megazine demo is viewed on a monitor big enough to accommodate the width/height of my book, everything works as expected, but when the monitor is small, the book can't be viewed completely, so I configure in megazine.asul the scrollpane with id="pagecontainer" with mousemode="mouse_move".

Then, the horizontal axis (x) is moved with the mouse, but the vertical axis (y) don't moves. Here is my definition:

Code: [Select]
<scrollpane id="pagecontainer" anchors="0,50,pw,pageh+50" clipchildren="false" mousemode="mouse_move">
        <box name="$viewport$" anchors="0,0,0,0" width="pagew*2" height="pageh" clipchildren="false" />
</scrollpane>

So I went to ScrollPane.as and added this line to updateConstraints(), about line 413, before constraints = new Rectangle...

Code: [Select]
if (stage && (viewport.height > 0) && (stage.stageHeight < viewport.height)) dy = -(stage.stageHeight/2);

Then, everything works as expected. I'm not sure if this is a fix or I'm configuring something wrong on my megazine.asul...

sound29

  • Newbie
  • *
  • Posts: 14
ScrollPane fix?
« Reply #1 on: March 16, 2010, 01:19:23 pm »
hi

if you have a problem in setting view size, you can add this in book definition (megazine.mz3)

maxscale="0.9" minscale="0.5"

(change values to fit your needs)

ismaelj

  • Newbie
  • *
  • Posts: 15
Re: ScrollPane fix?
« Reply #2 on: March 16, 2010, 03:54:29 pm »

maxscale="0.9" minscale="0.5"

(change values to fit your needs)

On my book I have

zoomminscale="0.6" zoommaxscale="2"

if you're refering these attributtes, but I don't have problems with these parameters. The problem I'm trying to solve is when the book is at an scale of 1 and the height is bigger than the height of the display (i.e: a 1000 pixels tall book on a 800 pixels display)
« Last Edit: March 16, 2010, 07:10:38 pm by ismaelj »

sound29

  • Newbie
  • *
  • Posts: 14
ScrollPane fix
« Reply #3 on: March 16, 2010, 08:51:47 pm »
I'm not talking of zoom parameter. try insert the command I gave you and you will always see the whole book.


ismaelj

  • Newbie
  • *
  • Posts: 15
Re: ScrollPane fix?
« Reply #4 on: March 17, 2010, 10:02:15 am »
In fact they're the same:

Megazine.as, line 2934:
Code: [Select]
settings.registerAlias("maxscale", "zoommaxscale");
settings.registerAlias("minscale", "zoomminscale");

sound29

  • Newbie
  • *
  • Posts: 14
ScrollPane fix
« Reply #5 on: March 17, 2010, 10:54:47 pm »
nothing to suggest.

if you need scale 1.0 and have a small screen, I think there's nothing to do. the screen problem is not a problem but THE problem for web display (not only for megazine).


ismaelj

  • Newbie
  • *
  • Posts: 15
Re: ScrollPane fix?
« Reply #6 on: March 19, 2010, 09:49:52 am »
My apologies! :-[
As you may guest, there was no "bug"! The problem was the way I was using the anchors attribute in the asul, I messed with the code doing some tests... :(
The right code is:
Code: (xml)
  1.  
  2.    <scrollpane id="pagecontainer" anchors="0,50,pw, ph" clipchildren="false" mousemode="mouse_move">
  3.        <box name="$viewport$" width="pagew*2" height="pageh" clipchildren="false" />
  4.    </scrollpane>
  5.