Define the maximum view limit.

@param surface The surface reference.
@param gridH The horizontal grid.
@param gridV The vertical grid.
@throws LionEngineException If <code>null</code> surface.
968447
private void setLimits(Surface surface, int gridH, int gridV)
    {
        Check.notNull(surface);

        if (gridH == 0)
        {
            limitRight = 0;
        }
        else
        {
            limitRight = Math.max(0, surface.getWidth() - UtilMath.getRounded(width, gridH));
        }
        if (gridV == 0)
        {
            limitTop = 0;
        }
        else
        {
            limitTop = Math.max(0, surface.getHeight() - UtilMath.getRounded(height, gridV));
        }
        limitLeft = 0;
        limitBottom = 0;

        moveLocation(1.0, 0.0, 0.0);
    }
779082
public void setCurrentViewport(float left, float top, float right, float bottom) {
        constrainViewport(left, top, right, bottom);
    }
745111
public final void setMaxWidth(final int maxWidth) {
        if (maxWidth != -1) {
            Condition.INSTANCE.ensureAtLeast(maxWidth, 1, "The maximum width must be at least 1");
        }

        this.maxWidth = maxWidth;
        requestLayout();
    }
378799
public final void setMaxDragDistance(final float maxDragDistance) {
        if (maxDragDistance != 0) {
            Condition.INSTANCE.ensureGreater(maxDragDistance, threshold,
                    "The maximum drag distance must be greater than " + threshold);
        }

        this.maxDragDistance = maxDragDistance;
    }
1260739
public void useMaxDimensions() {

        int availableHeight = CmsToolbarPopup.getAvailableHeight();
        int availableWidth = CmsToolbarPopup.getAvailableWidth();
        setDialogSize(availableWidth, availableHeight);
    }
431246
@Override
    public void setMaxRows(int max) throws SQLException
    {
        checkClosed();
        if (max < 0) {
            throw SQLError.get(SQLError.ILLEGAL_ARGUMENT, max);
        }
        this.maxRows = max;
    }
1106380
public void setPageMarginDrawable(Drawable d) {
        mMarginDrawable = d;
        if (d != null) refreshDrawableState();
        setWillNotDraw(d == null);
        invalidate();
    }
472319
public long gridDistance(Vector2ic v) {
        return Math.abs(v.x() - x()) + Math.abs(v.y() - y());
    }
55277
public static void resize(GVRMesh mesh, float size) {
        float dim[] = getBoundingSize(mesh);
        float maxsize = 0.0f;

        if (dim[0] > maxsize) maxsize = dim[0];
        if (dim[1] > maxsize) maxsize = dim[1];
        if (dim[2] > maxsize) maxsize = dim[2];

        scale(mesh, size / maxsize);
    }
55977
function GridBounds(bounds) {
  // [sw, ne]

  this.minX = Math.min(bounds[0].x, bounds[1].x);
  this.maxX = Math.max(bounds[0].x, bounds[1].x);
  this.minY = Math.min(bounds[0].y, bounds[1].y);
  this.maxY = Math.max(bounds[0].y, bounds[1].y);

}
1370001
function(elem) {
    var that = this, nodeAW = elem._angularWidth, sumAW = 0;
    elem.eachSubnode(function(child) {
      that.setSubtreeAngularWidth(child);
      sumAW += child._treeAngularWidth;
    }, "ignore");
    elem._treeAngularWidth = Math.max(nodeAW, sumAW);
  }
246500
private static void doLayout(
            final Graphics2D graphics2d, final ScalebarAttributeValues scalebarParams,
            final ScaleBarRenderSettings settings) {
        final Dimension maxLabelSize = getMaxLabelSize(settings);

        int numSubIntervals = 1;
        if (scalebarParams.subIntervals) {
            numSubIntervals = getNbSubIntervals(
                    settings.getScaleUnit(), settings.getIntervalLengthInWorldUnits(),
                    settings.getIntervalUnit());
        }

        settings.setBarSize(getBarSize(settings));
        settings.setLabelDistance(getLabelDistance(settings));
        settings.setLineWidth(getLineWidth(settings));
        settings.setSize(getSize(scalebarParams, settings, maxLabelSize));
        settings.setMaxLabelSize(maxLabelSize);
        settings.setNumSubIntervals(numSubIntervals);

        ScalebarDrawer drawer = scalebarParams.getType().createDrawer(graphics2d, settings);
        drawer.draw();
    }
527678
@Override
    public void setPixelSize(final int wide, final int high)
    {
        super.setPixelSize(wide, high);

        getViewport().setPixelSize(wide, high);

        getViewport().draw();
    }
562650
public void setViewportTopLeft(float left, float top) {
        /**
         * Constrains within the scroll range. The scroll range is simply the viewport extremes (AXIS_X_MAX,
         * etc.) minus
         * the viewport size. For example, if the extrema were 0 and 10, and the viewport size was 2, the scroll range
         * would be 0 to 8.
         */

        final float curWidth = currentViewport.width();
        final float curHeight = currentViewport.height();

        left = Math.max(maxViewport.left, Math.min(left, maxViewport.right - curWidth));
        top = Math.max(maxViewport.bottom + curHeight, Math.min(top, maxViewport.top));
        constrainViewport(left, top, left + curWidth, top - curHeight);
    }
394646
void onSurfaceChanged(int width, int height) {
        Log.v(TAG, "onSurfaceChanged");

        final VrAppSettings.EyeBufferParams.DepthFormat depthFormat = mApplication.getAppSettings().getEyeBufferParams().getDepthFormat();
        mApplication.getConfigurationManager().configureRendering(VrAppSettings.EyeBufferParams.DepthFormat.DEPTH_24_STENCIL_8 == depthFormat);
    }
1113182
public final void setNavigationWidth(@Px final int width) {
        Condition.INSTANCE.ensureGreater(width, 0, "The width must be greater than 0");
        this.navigationWidth = width;

        if (!isNavigationHidden()) {
            RelativeLayout.LayoutParams layoutParams =
                    (RelativeLayout.LayoutParams) toolbar.getLayoutParams();
            layoutParams.width = width;
            toolbar.requestLayout();
        }
    }
413342
@TargetApi(VERSION_CODES.FROYO)
    public final void maximize() {
        if (!isMaximized()) {
            if (!isShowing()) {
                maximize = true;
                show();
            } else {
                rootView.maximize(new AccelerateDecelerateInterpolator());
            }
        }
    }