Lines Matching refs:scale

175      * @return {@code true} if magnification is active, e.g. the scale
179 return mCurrentMagnificationSpec.scale > 1.0f;
186 * @param updateSpec {@code true} to update the scale and center based on
205 final float scale = sentSpec.scale;
211 + mMagnificationBounds.left - offsetX) / scale;
213 + mMagnificationBounds.top - offsetY) / scale;
215 scale, centerX, centerY, false, INVALID_ID);
268 * Returns the magnification scale. If an animation is in progress,
271 * @return the scale
274 return mCurrentMagnificationSpec.scale;
325 * Returns the scale currently used by the window manager. If an
329 * @return the scale currently used by the window manager
332 return mSpecAnimationBridge.mSentMagnificationSpec.scale;
358 * Resets the magnification scale and center, optionally animating the
392 * @param scale the target scale, must be >= 1
393 * @param pivotX the screen-relative X coordinate around which to scale
394 * @param pivotY the screen-relative Y coordinate around which to scale
401 public boolean setScale(float scale, float pivotX, float pivotY, boolean animate, int id) {
406 // Constrain scale immediately for use in the pivot calculations.
407 scale = MathUtils.constrain(scale, MIN_SCALE, MAX_SCALE);
412 final float oldScale = spec.scale;
417 final float offsetX = (oldCenterX - normPivotX) * (oldScale / scale);
418 final float offsetY = (oldCenterY - normPivotY) * (oldScale / scale);
422 return setScaleAndCenterLocked(scale, centerX, centerY, animate, id);
450 * Sets the scale and center of the magnified region, optionally
454 * @param scale the target scale, or {@link Float#NaN} to leave unchanged
456 * center and scale, or {@link Float#NaN} to leave unchanged
458 * center and scale, or {@link Float#NaN} to leave unchanged
466 float scale, float centerX, float centerY, boolean animate, int id) {
471 return setScaleAndCenterLocked(scale, centerX, centerY, animate, id);
475 private boolean setScaleAndCenterLocked(float scale, float centerX, float centerY,
477 final boolean changed = updateMagnificationSpecLocked(scale, centerX, centerY);
529 * Persists the current magnification scale to the current user's settings.
532 final float scale = mCurrentMagnificationSpec.scale;
539 Settings.Secure.ACCESSIBILITY_DISPLAY_MAGNIFICATION_SCALE, scale, userId);
546 * Retrieves a previously persisted magnification scale from the current
549 * @return the previously persisted magnification scale, or the default
550 * scale if none is available
561 * @param scale the magnification scale
569 private boolean updateMagnificationSpecLocked(float scale, float centerX, float centerY) {
577 if (Float.isNaN(scale)) {
578 scale = getScale();
590 final float normScale = MathUtils.constrain(scale, MIN_SCALE, MAX_SCALE);
591 if (Float.compare(currSpec.scale, normScale) != 0) {
592 currSpec.scale = normScale;
597 + mMagnificationBounds.left - centerX * scale;
605 + mMagnificationBounds.top - centerY * scale;
621 return viewportWidth - viewportWidth * mCurrentMagnificationSpec.scale;
626 return viewportHeight - viewportHeight * mCurrentMagnificationSpec.scale;
670 final float scale = getSentScale();
675 outFrame.scale(1.0f / scale);
717 final float scale = getScale();
718 offsetMagnifiedRegionCenter(scrollX * scale, scrollY * scale, INVALID_ID);
877 result.scale = fromSpec.scale + (toSpec.scale - fromSpec.scale) * fraction;