Lines Matching defs:scale

222      * @return {@code true} if magnification is active, e.g. the scale
226 return mCurrentMagnificationSpec.scale > 1.0f;
297 * Returns the magnification scale. If an animation is in progress,
300 * @return the scale
303 return mCurrentMagnificationSpec.scale;
354 * Returns the scale currently used by the window manager. If an
358 * @return the scale currently used by the window manager
361 return mSpecAnimationBridge.mSentMagnificationSpec.scale;
387 * Resets the magnification scale and center, optionally animating the
421 * @param scale the target scale, must be >= 1
422 * @param pivotX the screen-relative X coordinate around which to scale
423 * @param pivotY the screen-relative Y coordinate around which to scale
430 public boolean setScale(float scale, float pivotX, float pivotY, boolean animate, int id) {
435 // Constrain scale immediately for use in the pivot calculations.
436 scale = MathUtils.constrain(scale, MIN_SCALE, MAX_SCALE);
441 final float oldScale = spec.scale;
446 final float offsetX = (oldCenterX - normPivotX) * (oldScale / scale);
447 final float offsetY = (oldCenterY - normPivotY) * (oldScale / scale);
451 return setScaleAndCenterLocked(scale, centerX, centerY, animate, id);
479 * Sets the scale and center of the magnified region, optionally
483 * @param scale the target scale, or {@link Float#NaN} to leave unchanged
485 * center and scale, or {@link Float#NaN} to leave unchanged
487 * center and scale, or {@link Float#NaN} to leave unchanged
495 float scale, float centerX, float centerY, boolean animate, int id) {
500 return setScaleAndCenterLocked(scale, centerX, centerY, animate, id);
504 private boolean setScaleAndCenterLocked(float scale, float centerX, float centerY,
506 final boolean changed = updateMagnificationSpecLocked(scale, centerX, centerY);
558 * Persists the current magnification scale to the current user's settings.
561 final float scale = mCurrentMagnificationSpec.scale;
567 mSettingsBridge.putMagnificationScale(scale, userId);
574 * Retrieves a previously persisted magnification scale from the current
577 * @return the previously persisted magnification scale, or the default
578 * scale if none is available
587 * @param scale the magnification scale
595 private boolean updateMagnificationSpecLocked(float scale, float centerX, float centerY) {
603 if (Float.isNaN(scale)) {
604 scale = getScale();
610 final float normScale = MathUtils.constrain(scale, MIN_SCALE, MAX_SCALE);
611 if (Float.compare(mCurrentMagnificationSpec.scale, normScale) != 0) {
612 mCurrentMagnificationSpec.scale = normScale;
646 return viewportWidth - viewportWidth * mCurrentMagnificationSpec.scale;
651 return viewportHeight - viewportHeight * mCurrentMagnificationSpec.scale;
695 final float scale = getSentScale();
700 outFrame.scale(1.0f / scale);
742 final float scale = getScale();
743 offsetMagnifiedRegion(scrollX * scale, scrollY * scale, INVALID_ID);
891 mTmpMagnificationSpec.scale = mStartMagnificationSpec.scale +
892 (mEndMagnificationSpec.scale - mStartMagnificationSpec.scale) * fract;