Robert Hanson schrieb:
> 1. You know what size the applet is initially, because your callback 
> will report it.
> 2. You know what the applet size is in CSS by checking that 
> (document.getElementById("jmolApplet0").style.width, I think).
> 3. When the page opens and you get the resizeCallback, you correlate those.
> 4. If you get a resize callback you should be able to know if YOU did 
> the resize or the user did through zoom settings.
> 5. The CSS will report the new size, and Jmol will, too, perhaps. I 
> don't know.
> 6. Then just adjust the applet size to match the old size, making sure 
> to set a flag that disables the code in the callback for this next resize.
> 
> Right?
> 
The problem here is  number 5.
Let's assume an initial size of 600x600 pixel. Then the browser zoom 
setting is changed to 130%. Now the applet is 780x780 pixel. But CSS 
will still report 600x600 pixel.
If the resizeCallback would report the correct size (780x780), I could 
calculate the additional scaling factor 1.3.
But when I use this factor to calculate a new CSS setting that will 
result in the desired size of 600x600 I will get a rounding problem:
   600 / 1.3 = ~461.54
So I would have to set the new CSS size either to 461 or 462. and then 
the applet will be either 599x599 or 601x601 pixel.
So I will need a reliable non-CSS way to set the size directly without 
the additional factor.

Regards,
Rolf

------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users

Reply via email to