Author Topic: KeyShotVR - Default output won't scale in Firefox  (Read 4225 times)

0 Members and 1 Guest are viewing this topic.

Offline ec2638

KeyShotVR - Default output won't scale in Firefox
« on: March 23, 2013, 08:21:01 am »
The default .js and .htlm file KSVR puts out will not scale (resize to window - liquid layout) in Firefox 12.  It will scale in current Safari, Chrome and IE.  Tried fixing it in html with no luck.  You may need to tweak your .js VR outputs.

Any ideas?

Offline Ruckus

  • Full Member
  • ***
  • Posts: 137
  • Total likes: 0
  • Some mistakes are too much fun to make only once!
Re: KeyShotVR - Default output won't scale in Firefox
« Reply #1 on: March 26, 2013, 10:24:11 am »
Mozilla is up to Firefox 19 (they move through versions incredibly fast).  You might want to try that first.

Offline ec2638

Re: KeyShotVR - Default output won't scale in Firefox
« Reply #2 on: March 26, 2013, 11:12:50 am »
Silly me, I meant Firefox 19.0.2, but typed 12.  Sorry. 

Can get it to scale in all current versions of primary browsers except FF.  There may be a clever hack for that in html, but part of the reason for VR is one does not need to resort to such.  I assume the solution most likely resides in the .js code VR puts out.  For design presentations on the web we like it when the content will scale since we want to fill the viewers screen but we don't know the device and screen size.

Offline Morten Kristensen

  • root
  • Administrator
  • Full Member
  • *****
  • Posts: 142
  • Total likes: 1
  • Software Engineer, Luxion
Re: KeyShotVR - Default output won't scale in Firefox
« Reply #3 on: March 27, 2013, 02:24:20 am »
What version of KeyShot are you using, ec2638?
And could you supply me with your KeyShotVR output?
« Last Edit: March 27, 2013, 02:26:02 am by Morten Kristensen »

Offline ec2638

Re: KeyShotVR - Default output won't scale in Firefox
« Reply #4 on: March 28, 2013, 02:42:21 pm »
Thanks for responding, Morten.  I should be more specific.

Version 4.0.74.  You don't really need my output.  Situation is the same for any output.

As I assume you are well aware, the html VR outputs does not scale by default, rather it just repositions (centers) the animation inside the browser window when the window is re-sized (all browsers).  That is good, however, in attempting to modify the default behavior I did change one line in the VR html.

Changed default from:
var windowResizable = true;

Changed to:
var windowResizable = false;

Result - whether loading the animation from the edited default VR htlm or from another page where the edited default VR was displayed via an iframe, the animation would proportionally scale down, or scale up...up to the value set in:

 var imageWidth = 800;
 var imageHeight = 450;

It would do so in all browsers EXCEPT FIREFOX.  I tried to find a solution in the .js...but frankly such is beyond me.

As mentioned, the impetus was to fill the screen...or the iframe for all potential viewers.  In such a layout one would render out the VR at the maximum expected or desired screen size, with confidence that it will scale to any screen size or the individual's browser window, again basic liquid layouts.

The goal here obviously is to add value, and I'm sure there is a much more elegant and clever way for you guys to code things so your users could select scaling (liquid layout) or static when they setup the render.  I just assumed (correctly or incorrectly) that the fix to my simple hack in FF probably resides in the .js. (could not find any html to add to make FF do what I wanted).  I hope this is something you address in future.

The VR is in the attached .zip, but again it is just a 30 sec output of your default cube model.

Thanks!


Offline Morten Kristensen

  • root
  • Administrator
  • Full Member
  • *****
  • Posts: 142
  • Total likes: 1
  • Software Engineer, Luxion
Re: KeyShotVR - Default output won't scale in Firefox
« Reply #5 on: April 02, 2013, 01:17:52 am »
Sorry for the slow reply. We had an Easter holiday here.

Thank you for spotting this issue. The problem is that the "max-width" is not always respected in Firefox for some reason. A fix will be made available in the next update of KeyShot.
However, if you want a quick & dirty fix right now then do the following:

  • Open "untitled_VR.37/untitled_VR.37/files/KeyShotVR.js" for editing.
  • Find the following code fragment: q.style["max-width"]="100%"
  • Change it to be: q.style["width"]="100%"

With this fix the VR will scale to fit the window as is expected - just as it did before in other browsers.

Offline Ruckus

  • Full Member
  • ***
  • Posts: 137
  • Total likes: 0
  • Some mistakes are too much fun to make only once!
Re: KeyShotVR - Default output won't scale in Firefox
« Reply #6 on: April 02, 2013, 05:16:04 am »
Nice little hack, Morten.
Thanks for the tip. :)

Offline ec2638

Re: KeyShotVR - Default output won't scale in Firefox
« Reply #7 on: April 02, 2013, 10:13:51 am »
Very nice!  Thank you for both the quick workaround and the future fix.  Much appreciated, Morten.

Offline Morten Kristensen

  • root
  • Administrator
  • Full Member
  • *****
  • Posts: 142
  • Total likes: 1
  • Software Engineer, Luxion
Re: KeyShotVR - Default output won't scale in Firefox
« Reply #8 on: April 02, 2013, 10:31:42 am »
You are both very welcome. It's always nice when bugs are spotted by our faithful users.  :)