mpetroff/pannellum — pull request #14 by PhobosK (2014-09-02 20:59:44+00:00)
Title: Fix autoRotate when limiting yaw and several other fixes

As I discussed in my previous issue (mpetroff/pannellum#13), my proposed code broke autoRotate, so I fix that now. The idea behind the fix is that when one limits the yaw, the rotate when reaching minyaw changes direction and then when reaching the maxyaw changes direction again.

Other fixes include:
* **Fix error box behavior when loading next scene** - When one uses WebGL on a full equirectangular panorama if the panorama is too large it gives a WebGL error (and a respective error box in pannellum). This all blocks further tour for example if there are hotspots available. So I made the error box to be cleared (display:none;) every time *load()* is called, so the user to be able to load another scene that may be less resource hungry (and thus not giving any error)
* **Fix preview image behavior** Preview image is sized auto. This makes it dependent on its own size and the size of the parent iframe (giving tiled or cropped results when there is inconsistency between the iframe and the image size). I think a size of "100% 100%" is a better choice.
* **Fix multires hfov behavior in fullscreen/wide mode** - I am not good at maths, so I do not know why is all that code separation for multires in *setHfov(i)*, but there is a very strange zooming problem when using a wide iframe(or fullscreen on a wide monitor 1920x1080 and a *cubeResolution* of 1216 or 1432 maybe other resoliutions too but I have not tested that thouroughly). The problem is that there are only two levels of zooming and the one is not at all good at 157 deg. Anyway I removed all that code and left only a check for the min and max yaw. It works ok with my two multires panoramas. These are their configs:
```
"multiRes": {
"basePath": "img/multires/room2",
"path": "/%l/%s%y_%x",
"fallbackPath": "/fallback/%s",
"extension": "jpg",
"tileResolution": 512,
"maxLevel": 3,
"cubeResolution": 1432
}

```

```
"multiRes": {
"basePath": "img/multires/room2",
"path": "/%l/%s%y_%x",
"fallbackPath": "/fallback/%s",
"extension": "jpg",
"tileResolution": 512,
"maxLevel": 3,
"cubeResolution": 1216
},
```

I hope you will like the proposed changes.

Thanks :)