Author Topic: Disable Liquid Scaling Completely  (Read 862 times)

Ecnassianer

  • Sr. Member
  • ****
  • Posts: 126
    • Carpe Chaos
Disable Liquid Scaling Completely
« on: March 29, 2010, 04:01:06 am »
I'm using zoominit to disable liquid scaling when I load my book.

When I zoom in and out with the navbar or mouse wheel, one of the zoom levels is a liquid scaled zoom that matches the browser window.

I'm using Adaptive Zoom and I only want users to be able to select zoom levels that I have source images for, so I don't want this liquid zoom scale.

How do I disable liquid zoom when zooming in and out?
See my megazine at CarpeChaos.com

Hans Nücke

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 787
  • MegaZine3 Sales Manager
Re: Disable Liquid Scaling Completely
« Reply #1 on: March 29, 2010, 09:07:49 am »
This will be easily possible with the next version v2.0.7
You'll have a new book parameter  "zoomsnap" that will do exactly what you want: snap in at predefined zoom levels.
Example: <book zoomsnap="0.25, 0.5, 1.0, 2.0, 4.0" .. .. >

This is already working with the version in the SVN /trunk

There is no release date fixed, but we expect the next release within the next 10 days or so...

Ecnassianer

  • Sr. Member
  • ****
  • Posts: 126
    • Carpe Chaos
Re: Disable Liquid Scaling Completely
« Reply #2 on: March 30, 2010, 08:02:28 pm »
Does that mean zoomsnap will make zoomstep have no affect? Cooool....
See my megazine at CarpeChaos.com

Florian Nücke

  • κρύα πόδια
  • Administrator
  • Hero Member
  • *****
  • Posts: 1985
  • MegaZine3 Developer
    • MegaZine3
Re: Disable Liquid Scaling Completely
« Reply #3 on: March 30, 2010, 08:33:11 pm »
Basically it works like this:
zoomstep defines the number of zoom levels there are in total (minimum is therefore 2: minscale and maxscale).
zoomsnap defines at which zoom levels to snap to a certain value. If, when zooming in or out, one such snap point is passed, the new scale will be set to that value.
This also results in a sideeffect though: there can be more zoomsteps than set in zoomstep.
Futhermore, per default the current zoom scale that would result from liquid scaling will also be used as a snap point, to allow reactivating liquid scaling.
To completely disable liquid scaling, I've added a new attribute: book@zoomliquidscaling. Set that to false to disable liquid scaling.
Lastly, if only the zoomsnap values should be valid scale levels, just set zoomstep to 2, and when zooming in or out you will always jump from one snap to another (because you're guaranteed to "pass" one, as you'd otherwise go from min to max).
For the Snark was a Boojum, you see.

Before you ask a question
          After you get an answer
  • please document your problem with the answer in the Project Wiki. (e.g. in the FAQs)
  • help others out if you can, by answering their questions on the forum.

Ecnassianer

  • Sr. Member
  • ****
  • Posts: 126
    • Carpe Chaos
Re: Disable Liquid Scaling Completely
« Reply #4 on: March 31, 2010, 11:27:02 pm »
Ah. Might I suggest the variable name "zoomsteps" instead of "zoomstep".

zoomsteps = 5

reads much more like:

There are 5 steps to zoom.

I think that gets at your intention much more clearly.

And personally, when I upgrade software, I'd prefer to be notified that zoomstep is no longer a valid attribute, rather than have it's behavior silently changed on a point revision. But take that argument with a grain of salt, since I'm sure there are others who would disagree.

See my megazine at CarpeChaos.com

Florian Nücke

  • κρύα πόδια
  • Administrator
  • Hero Member
  • *****
  • Posts: 1985
  • MegaZine3 Developer
    • MegaZine3
Re: Disable Liquid Scaling Completely
« Reply #5 on: April 04, 2010, 03:26:23 pm »
Right. Renamed it to zoomsteps. This way I can also have the zoomstep
one behave as before, so updating won't break stuff. And I'll remove
zoomstep from the DTD so that it doesn't validate (which serves as the
"notification").
For the Snark was a Boojum, you see.

Before you ask a question
          After you get an answer
  • please document your problem with the answer in the Project Wiki. (e.g. in the FAQs)
  • help others out if you can, by answering their questions on the forum.