Improve texture lock

Prefer the longest texture side to determine the fixed axis for the rotation angles.
Fix an inititalization crash on Mac.
Fix a minor problem in the publishing script.
Fix some visual glitches in clip mode when shift is pressed.