Set viewport orientation
357618
function() {
            if (typeof window.orientation == 'undefined') {

                if (pgwBrowser.viewport.width >= pgwBrowser.viewport.height) {
                    pgwBrowser.viewport.orientation = 'landscape';
                } else {
                    pgwBrowser.viewport.orientation = 'portrait';
                }

            } else {
                switch(window.orientation) {
                    case -90:
                    case 90:
                        pgwBrowser.viewport.orientation = 'landscape';
                        break;
                    default:
                        pgwBrowser.viewport.orientation = 'portrait';
                        break; 
                }
            }

            // Orientation trigger
            $(window).trigger('PgwBrowser::OrientationChange');

            return true;
        }
1324939
public function setViewport($width = 'device-width', $initial_scale = '1', $user_scalable = '', $minimum_scale = '', $maximum_scale = '')
    {
        $tag = [
            'name' => 'viewport',
            'content' => 'width=' . $width . ', initial-scale=' . $initial_scale
        ];

        if ($user_scalable) {
            $tag['content'] .= ', user-scalable=' . $user_scalable;
        }

        if ($minimum_scale) {
            $tag['content'] .= ', minimum-scale=' . $minimum_scale;
        }

        if ($maximum_scale) {
            $tag['content'] .= ', maximum_scale=' . $maximum_scale;
        }

        $this->tags['viewport'] = $tag;
    }
810806
function(layerPx) {
        var viewPortPx = null;
        if (layerPx != null) {
            var dX = this.layerContainerOriginPx.x;
            var dY = this.layerContainerOriginPx.y;
            viewPortPx = layerPx.add(dX, dY);            
        }
        return viewPortPx;
    }
308107
function() {
        var c = this._canvas;
        c.width = Crafty.viewport.width;
        c.height = Crafty.viewport.height;

        var gl = this.context;
        gl.viewportWidth = c.width;
        gl.viewportHeight = c.height;
    }
1359620
def _update_rotation(self, event):
        """"""
        p2 = event.mouse_event.pos
        if self._event_value is None:
            self._event_value = p2
        wh = self._viewbox.size
        self._quaternion = (Quaternion(*_arcball(p2, wh)) *
                            Quaternion(*_arcball(self._event_value, wh)) *
                            self._quaternion)
        self._event_value = p2
        self.view_changed()
1063027
def on_resize(self, event):
        """"""
        self.context.set_viewport(0, 0, event.size[0], event.size[1])
        for visual in self.visuals:
            visual.on_resize(event.size)
        self.update()
894737
function () {
            // Sets properties of '_features' that change on resize and/or orientation.
            var w   = win.innerWidth || _viewport.clientWidth,
                h   = win.innerHeight || _viewport.clientHeight,
                dw  = win.screen.width,
                dh  = win.screen.height,
                c   = win.screen.colorDepth,
                x   = win.devicePixelRatio;

            _features.width                     = w;
            _features.height                    = h;
            _features['aspect-ratio']           = (w / h).toFixed(2);
            _features['device-width']           = dw;
            _features['device-height']          = dh;
            _features['device-aspect-ratio']    = (dw / dh).toFixed(2);
            _features.color                     = c;
            _features['color-index']            = Math.pow(2, c);
            _features.orientation               = (h >= w ? 'portrait' : 'landscape');
            _features.resolution                = (x && x * 96) || win.screen.deviceXDPI || 96;
            _features['device-pixel-ratio']     = x || 1;
        }
34166
def set_left_to_right(self):
        """"""
        self.displaymode |= LCD_ENTRYLEFT
        self.write8(LCD_ENTRYMODESET | self.displaymode)
75319
public void setMaxViewport(float left, float top, float right, float bottom) {
        this.maxViewport.set(left, top, right, bottom);
        computeMinimumWidthAndHeight();
    }
188953
def set_gl_transform(self):
        
        tangent = np.tan(self.fov_deg / 2.0 / 180.0 * np.pi)
        vport_radius = self.near_plane * tangent
        # calculate aspect of the viewport
        if self.vport_wd_px < self.vport_ht_px:
            vport_wd = 2.0 * vport_radius
            vport_ht = vport_wd * self.vport_ht_px / float(self.vport_wd_px)

        else:
            vport_ht = 2.0 * vport_radius
            vport_wd = vport_ht * self.vport_wd_px / float(self.vport_ht_px)

        gl.glFrustum(
            -0.5 * vport_wd, 0.5 * vport_wd,    # left, right
            -0.5 * vport_ht, 0.5 * vport_ht,    # bottom, top
            self.near_plane, self.far_plane
        )

        M = Matrix4x4.look_at(self.position, self.target, self.up, False)
        gl.glMultMatrixf(M.get())
123747
public void setMaxViewport(Viewport maxViewport) {
        setMaxViewport(maxViewport.left, maxViewport.top, maxViewport.right, maxViewport.bottom);
    }
656357
protected boolean setViewPort(final Canvas pCanvas, final Projection pProjection) {
		setProjection(pProjection);
		getProjection().getMercatorViewPort(mViewPort);
		return true;
	}
1259431
public void setShiftOrientation(OrientedLayout.Orientation orientation) {
        if (mShiftLayout.getOrientation() != orientation &&
                orientation != OrientedLayout.Orientation.STACK) {
            mShiftLayout.setOrientation(orientation);
            requestLayout();
        }
    }
1007256
def setOrientation( self, orientation ):
        
        super(XSplitterHandle, self).setOrientation(orientation)
        
        if ( orientation == Qt.Vertical ):
            self.layout().setDirection( QBoxLayout.LeftToRight )
            
            # update the widgets
            self._collapseBefore.setFixedSize(30, 10)
            self._collapseAfter.setFixedSize(30, 10)
            self._resizeGrip.setFixedSize(60, 10)
            
            self._collapseBefore.setArrowType(Qt.UpArrow)
            self._collapseAfter.setArrowType(Qt.DownArrow)
            
        elif ( orientation == Qt.Horizontal ):
            self.layout().setDirection( QBoxLayout.TopToBottom )
            
            # update the widgets
            self._collapseBefore.setFixedSize(10, 30)
            self._collapseAfter.setFixedSize(10, 30)
            self._resizeGrip.setFixedSize(10, 60)
            
            self._collapseBefore.setArrowType(Qt.LeftArrow)
            self._collapseAfter.setArrowType(Qt.RightArrow)
1263604
function syncViewports (layers, activeLayer) {
  // If we intend to keep the viewport's scale, translation and rotation in sync,
  // loop through the layers
  layers.forEach((layer) => {
    // Don't do anything to the active layer
    // Don't do anything if this layer has no viewport
    if (layer === activeLayer ||
        !layer.viewport ||
        !activeLayer.viewport) {
      return;
    }

    if (!layer.syncProps) {
      updateLayerSyncProps(layer);
    }

    const viewportRatio = getViewportRatio(activeLayer, layer);

    // Update the layer's translation and scale to keep them in sync with the first image
    // based on the ratios between the images
    layer.viewport.scale = activeLayer.viewport.scale * viewportRatio;
    layer.viewport.rotation = activeLayer.viewport.rotation;
    layer.viewport.translation = {
      x: (activeLayer.viewport.translation.x / viewportRatio),
      y: (activeLayer.viewport.translation.y / viewportRatio)
    };
    layer.viewport.hflip = activeLayer.viewport.hflip;
    layer.viewport.vflip = activeLayer.viewport.vflip;
  });
}
37086
function setOrientationHTML(desiredOrientation) {
    desiredOrientation = desiredOrientation || "";
    if (!orientationDiv) {
      orientationDiv = document.createElement("div");
      //document.body.appendChild(orientationDiv);
      var h = document.getElementById("hft-menu");
      h.parentNode.insertBefore(orientationDiv, h);
    }
    if (desiredOrientation.indexOf("portrait") >= 0) {
      orientationDiv.innerHTML = requirePortraitHTML;
    } else if (desiredOrientation.indexOf("landscape") >= 0) {
      orientationDiv.innerHTML = requireLandscapeHTML;
    } else {
      orientationDiv.innerHTML = "";
    }
  }
989005
def set_orientation(self, orientation='landscape'):
        
        if orientation not in ALLOWED_ORIENTATIONS:
            _LOGGER.debug('%s is not a valid orientation', orientation)
            return False
        return self.change_setting('orientation', orientation)