Offsets the menu relative to its original position based on the position of the content.

@param offsetPixels The number of pixels the content if offset.
321107
private void offsetMenu(int offsetPixels) {
        if (!mOffsetMenu || mMenuSize == 0) {
            return;
        }

        final int width = getWidth();
        final int height = getHeight();

        final int menuSize = mMenuSize;
        final int sign = (int) (mOffsetPixels / Math.abs(mOffsetPixels));
        final float openRatio = Math.abs(mOffsetPixels) / menuSize;
        final int offset = (int) (-0.25f * ((1.0f - openRatio) * menuSize) * sign);

        switch (getPosition()) {
            case LEFT: {
                if (USE_TRANSLATIONS) {
                    if (offsetPixels > 0) {
                        mMenuContainer.setTranslationX(offset);
                    } else {
                        mMenuContainer.setTranslationX(-menuSize);
                    }

                } else {
                    mMenuContainer.offsetLeftAndRight(offset - mMenuContainer.getLeft());
                    mMenuContainer.setVisibility(offsetPixels == 0 ? INVISIBLE : VISIBLE);
                }
                break;
            }

            case RIGHT: {
                if (USE_TRANSLATIONS) {
                    if (offsetPixels != 0) {
                        mMenuContainer.setTranslationX(offset);
                    } else {
                        mMenuContainer.setTranslationX(menuSize);
                    }

                } else {
                    final int oldOffset = mMenuContainer.getRight() - width;
                    final int offsetBy = offset - oldOffset;
                    mMenuContainer.offsetLeftAndRight(offsetBy);
                    mMenuContainer.setVisibility(offsetPixels == 0 ? INVISIBLE : VISIBLE);
                }
                break;
            }

            case TOP: {
                if (USE_TRANSLATIONS) {
                    if (offsetPixels > 0) {
                        mMenuContainer.setTranslationY(offset);
                    } else {
                        mMenuContainer.setTranslationY(-menuSize);
                    }

                } else {
                    mMenuContainer.offsetTopAndBottom(offset - mMenuContainer.getTop());
                    mMenuContainer.setVisibility(offsetPixels == 0 ? INVISIBLE : VISIBLE);
                }
                break;
            }

            case BOTTOM: {
                if (USE_TRANSLATIONS) {
                    if (offsetPixels != 0) {
                        mMenuContainer.setTranslationY(offset);
                    } else {
                        mMenuContainer.setTranslationY(menuSize);
                    }

                } else {
                    final int oldOffset = mMenuContainer.getBottom() - height;
                    final int offsetBy = offset - oldOffset;
                    mMenuContainer.offsetTopAndBottom(offsetBy);
                    mMenuContainer.setVisibility(offsetPixels == 0 ? INVISIBLE : VISIBLE);
                }
                break;
            }
        }

    }
64780
private void setFrame(int a, int b, float offset) {
		current = (Shape) shapes.get(a);
		next = (Shape) shapes.get(b);
		this.offset = offset;
		pointsDirty = true;
	}
1037117
@Override
	public void setSecondAxis(double x, double y, double z, double extent) {
		setSecondAxis(x, y, z, extent, CoordinateSystem3D.getDefaultCoordinateSystem());
	}
153628
def get_offset
      platform = ChromedriverScreenshot::Platforms.platform
      offset_x = @x - platform.window_x
      offset_y = @y - platform.window_y
      [offset_x, offset_y]
    end
1282113
function(options) {
        this.position = new OpenLayers.Pixel(OpenLayers.Control.PanZoom.X,
                                             OpenLayers.Control.PanZoom.Y);
        OpenLayers.Control.prototype.initialize.apply(this, arguments);
    }
1362212
public void setIconPos(IconPos pos) {
        if (pos == null) {
            JQMCommon.setIconPos(this, pos);
        } else {
            IconPos oldPos = getIconPos();
            JQMCommon.setIconPos(this, pos);
            for (int i = 0; i < buttons.size(); i++) {
                JQMButton btn = buttons.get(i);
                IconPos p = btn.getIconPos();
                if (p == null || oldPos == null || p.equals(oldPos)) btn.setIconPos(pos);
            }
        }
    }
617567
@Override
    public void addPixels(int[] pixels, int offset, int count) {
        for (int i = 0; i < count; i++) {
            insertColor(pixels[i + offset]);
            if (colors > reduceColors)
                reduceTree(reduceColors);
        }
    }
965872
public void adjustOffsets(final IGeoPoint pGeoPoint, final PointF pPixel) {
		if (pPixel == null) {
			return;
		}
		final Point unRotatedExpectedPixel = unrotateAndScalePoint((int)pPixel.x, (int)pPixel.y, null);
		final Point unRotatedActualPixel = toPixels(pGeoPoint, null);
		final long deltaX = unRotatedExpectedPixel.x - unRotatedActualPixel.x;
		final long deltaY = unRotatedExpectedPixel.y - unRotatedActualPixel.y;
		adjustOffsets(deltaX, deltaY);
	}
797474
def horz_offset(self, offset):
        
        if offset == 0.0:
            self._remove_manualLayout()
            return
        manualLayout = self.get_or_add_manualLayout()
        manualLayout.horz_offset = offset
1096586
def scroll_y(self, pixels, relative=True):
        '''
        
        '''
        if relative:
            self.offset.y += int(pixels)
        else:
            self.offset.y = int(pixels)
        self._update()
555621
private static void setOffsetHeight(final Widget widget, int height) {
    widget.setHeight(height + "px");
    final int offset = widget.getOffsetHeight();
    if (offset > 0) {
      height -= offset - height;
      if (height > 0) {
        widget.setHeight(height + "px");
      }
    }
  }
1118992
public void setPageMargin(int marginPixels) {
        final int oldMargin = mPageMargin;
        mPageMargin = marginPixels;

        final int width = getWidth();
        recomputeScrollPosition(width, width, marginPixels, oldMargin);

        requestLayout();
    }
188753
function getPixelSetter() {
    var offset = 0;
    return function(colors, c) {
        colors[offset] = c.r;
        colors[offset + 1] = c.g;
        colors[offset + 2] = c.b;
        colors[offset + 3] = c.a;
        offset += 4;
    };
}
252788
def horz_offset(self, offset):
        
        self.get_or_add_xMode().val = ST_LayoutMode.FACTOR
        self.get_or_add_x().val = offset
1055736
public void setOffset(float offset, final Axis axis) {
        if (!equal(mOffset.get(axis), offset)) {
            mOffset.set(offset, axis);
            if (mContainer != null) {
                mContainer.onLayoutChanged(this);
            }
        }
    }
1303317
public Icon offset(int offsetX, int offsetY)
	{
		initSprite(sheetWidth, sheetHeight, getOriginX() + offsetX, getOriginY() + offsetY, isRotated());
		return this;
	}
1276848
private void setContentOffset(int startX, int startY, Translation translation, int movementAmount) {

        if (translation == Translation.VERTICAL) {

            // center the X around the start point
            int originalStartX = startX;
            startX -= contentParams.width / 2;

            // if Y is in the lower half, we want it to go up, otherwise, leave it the same
            boolean moveDown = true;
            if (startY + contentParams.height + FINGER_SIZE > screenHeight) {
                startY -= contentParams.height;
                moveDown = false;

                if (movementAmount > 0) {
                    movementAmount *= -1;
                }
            }

            // when moving the peek view below the finger location, we want to offset it a bit to the right
            // or left as well, just so the hand doesn't cover it up.
            int extraXOffset = 0;
            if (moveDown) {
                extraXOffset = DensityUtils.toPx(getContext(), 200);
                if (originalStartX > screenWidth / 2) {
                    extraXOffset = extraXOffset * -1; // move it a bit to the left
                }
            }

            // make sure they aren't outside of the layout bounds and move them with the movementAmount
            // I move the x just a bit to the right or left here as well, because it just makes things look better
            startX = ensureWithinBounds(startX + extraXOffset, screenWidth, contentParams.width);
            startY = ensureWithinBounds(startY + movementAmount, screenHeight, contentParams.height);

        } else {

            // center the Y around the start point
            startY -= contentParams.height / 2;

            // if X is in the right half, we want it to go left
            if (startX + contentParams.width + FINGER_SIZE > screenWidth) {
                startX -= contentParams.width;
                if (movementAmount > 0) {
                    movementAmount *= -1;
                }
            }

            // make sure they aren't outside of the layout bounds and move them with the movementAmount
            startX = ensureWithinBounds(startX + movementAmount, screenWidth, contentParams.width);
            startY = ensureWithinBounds(startY, screenHeight, contentParams.height);
        }

        // check to see if the system bars are covering anything

        int statusBar = NavigationUtils.getStatusBarHeight(getContext());
        if (startY < statusBar) { // if it is above the status bar and action bar
            startY = statusBar + 10;
        } else if (NavigationUtils.hasNavBar(getContext()) &&
                startY + contentParams.height > screenHeight - NavigationUtils.getNavBarHeight(getContext())) {
            // if there is a nav bar and the popup is underneath it
            startY = screenHeight - contentParams.height - NavigationUtils.getNavBarHeight(getContext()) - DensityUtils.toDp(getContext(), 10);
        } else if (!NavigationUtils.hasNavBar(getContext()) && startY + contentParams.height > screenHeight) {
            startY = screenHeight - contentParams.height - DensityUtils.toDp(getContext(), 10);
        }

        // set the newly computed distances from the start and top sides
        setDistanceFromLeft(startX);
        setDistanceFromTop(startY);
    }