Author Topic: problem with area size  (Read 900 times)

Sertara

  • Newbie
  • *
  • Posts: 2
problem with area size
« on: August 17, 2009, 03:29:26 pm »
Hi guys. This tool is very great!!
i have a question: i'm creating linkable areas on pages, but i noticed that i can't set this areas' size smaller than 30 pixel in both width and height!
if i set them smaller than 30 pixel, when i open the book, they are shown as a little square of 30x30.

this is an example of what i wrote in my .xml file:

<area id="0" overlay="border[0.25,6,0x00FF00]; color[0.1,0.5,0xFFFF00];" url="anchor:5" target="_blank" left="280" top="36" width="5" height="5"/>

i wanted an area of 5x5 but, as i said, the book automatically set them 30x30!
if i set the width or the height bigger than 30px there are no problems, but i can't set smaller!

someone can help me? have i written any mistake in the code?
thank you in advance ;)

Florian Nücke

  • κρύα πόδια
  • Administrator
  • Hero Member
  • *****
  • Posts: 1989
  • MegaZine3 Developer
    • MegaZine3
Re: problem with area size
« Reply #1 on: August 17, 2009, 04:48:42 pm »
Was too lazy to dig out the old version, but when trying it with the current development snapshot it worked (i.e. it was 5 by 5 pixels). New version will be out in about two weeks, I think. Until then, please endure ;)
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.

WillyCornbread

  • Newbie
  • *
  • Posts: 2
Re: problem with area size
« Reply #2 on: August 29, 2009, 04:38:10 pm »
Hi - I had this same problem. The issue is that the loader for the elements is 30x30 in the library, and the container maintains the width/height of it's largest child.

To keep the preloader and correct, add the following line of code to AbstractElement Constructor method:

After this EXISTING line of code in the Constructor method:
Code: [Select]
loading = library.getInstanceOf(
                        LibraryConstants.LOADING_SIMPLE);

Add this line that will check to see if the height or width of the element is smaller than the loader, and if so scale the loader down appropriately, never scaling up:
Code: [Select]
loading.scaleX = loading.scaleY =  Math.min(Math.min(xml.@width / loading.width,xml.@height / loading.height),1);
Hope that helps -

b