Resizing Behavior
170664
public static void resizingBehaviorApply(ResizingBehavior behavior, RectF rect, RectF target, RectF result) {
    if (rect.equals(target) || target == null) {
      result.set(rect);
      return;
    }

    if (behavior == ResizingBehavior.Stretch) {
      result.set(target);
      return;
    }

    float xRatio = Math.abs(target.width() / rect.width());
    float yRatio = Math.abs(target.height() / rect.height());
    float scale = 0f;

    switch (behavior) {
      case AspectFit: {
        scale = Math.min(xRatio, yRatio);
        break;
      }
      case AspectFill: {
        scale = Math.max(xRatio, yRatio);
        break;
      }
      case Center: {
        scale = 1f;
        break;
      }
      default:
        break;
    }

    float newWidth = Math.abs(rect.width() * scale);
    float newHeight = Math.abs(rect.height() * scale);
    result.set(target.centerX() - newWidth / 2,
      target.centerY() - newHeight / 2,
      target.centerX() + newWidth / 2,
      target.centerY() + newHeight / 2);
  }
446352
def resize(self, new_size):
        """"""
        assert new_size > self.size
        new_data = self._allocate(new_size)
        # copy
        new_data[0:self.size * self.chunk_size] = self.data
        self.size = new_size
        self.data = new_data
1371089
@Override protected void resize() {
        width  = gauge.getWidth() - gauge.getInsets().getLeft() - gauge.getInsets().getRight();
        height = gauge.getHeight() - gauge.getInsets().getTop() - gauge.getInsets().getBottom();

        if (aspectRatio * width > height) {
            width = 1 / (aspectRatio / height);
        } else if (1 / (aspectRatio / height) > width) {
            height = aspectRatio * width;
        }

        if (width > 0 && height > 0) {
            pane.setMaxSize(width, height);
            pane.setPrefSize(width, height);
            pane.relocate((gauge.getWidth() - width) * 0.5, (gauge.getHeight() - height) * 0.5);
            pane.setSpacing(width * 0.01960784);

            double barWidth = 0;
            for (int i = 0 ; i < 12 ; i++) {
                bars[i].setPrefSize(0.3030303 * height, (0.3030303 * height + i * 0.06060606 * height));
                Bounds bounds = bars[i].getLayoutBounds();
                barWidth      = bounds.getWidth();
                if (barWidth == 0) return;

                BarColor barColor;
                if (i < 2) {
                    barColor = BarColor.RED;
                } else if (i < 9) {
                    barColor = BarColor.ORANGE;
                } else {
                    barColor = BarColor.GREEN;
                }
                barBackgrounds[i] = new Background(new BackgroundFill[] {
                    new BackgroundFill(Color.WHITE, new CornerRadii(1024), Insets.EMPTY),
                    new BackgroundFill(new LinearGradient(0, bounds.getMinY(), 0, bounds.getMaxY(), false, CycleMethod.NO_CYCLE, new Stop(0.0, barColor.COLOR_FROM), new Stop(1.0, barColor.COLOR_TO)), new CornerRadii(1024), new Insets(0.15 * barWidth))
                });
                barBackgrounds[i + 12] = new Background(new BackgroundFill[] {
                    new BackgroundFill(Color.WHITE, new CornerRadii(1024), Insets.EMPTY),
                    new BackgroundFill(new LinearGradient(0, bounds.getMinY(), 0, bounds.getMaxY(), false, CycleMethod.NO_CYCLE, new Stop(0.0, BarColor.GRAY.COLOR_FROM), new Stop(1.0, BarColor.GRAY.COLOR_TO)), new CornerRadii(1024), new Insets(0.15 * barWidth))
                });
            }
            barBorder = new Border(new BorderStroke(Color.rgb(102, 102, 102), BorderStrokeStyle.SOLID, new CornerRadii(1024), new BorderWidths(0.05 * barWidth)));
        }
        redraw();
    }
791463
public void onResize(final ResizeEvent event) {

        if ((m_selectedItem != null) && m_selectedItem.hasSubmenu()) {

            Scheduler.get().scheduleDeferred(new ScheduledCommand() {

                /**
                 * @see com.google.gwt.user.client.Command#execute()
                 */
                public void execute() {

                    getSelectedItem().getSubMenu().setSubMenuPosition(getSelectedItem());
                    getSelectedItem().getSubMenu().onResize(event);
                }
            });
        }
    }
846967
@Override protected void resize() {
        width  = clock.getWidth() - clock.getInsets().getLeft() - clock.getInsets().getRight();
        height = clock.getHeight() - clock.getInsets().getTop() - clock.getInsets().getBottom();

        if (aspectRatio * width > height) {
            width = 1 / (aspectRatio / height);
        } else if (1 / (aspectRatio / height) > width) {
            height = aspectRatio * width;
        }

        centerX = width * 0.5;
        centerY = height * 0.5;

        if (width > 0 && height > 0) {
            pane.setMaxSize(width, height);
            pane.relocate((clock.getWidth() - height) * 0.5, (clock.getHeight() - height) * 0.5);

            canvas.setWidth(width);
            canvas.setHeight(height);
        }
    }
562909
@Override protected void resize() {
        super.resize();
        centerX    = width * 0.5;
        centerY    = height * 0.5;
        flapHeight = height * 0.495;

        upperBackground.setWidth(width);
        upperBackground.setHeight(flapHeight);

        lowerBackground.setWidth(width);
        lowerBackground.setHeight(flapHeight);
        lowerBackground.setTranslateY(height - flapHeight);

        upperBackgroundText.setWidth(width);
        upperBackgroundText.setHeight(flapHeight);

        lowerBackgroundText.setWidth(width);
        lowerBackgroundText.setHeight(flapHeight);
        lowerBackgroundText.setTranslateY(height - flapHeight);

        flap.setWidth(width);
        flap.setHeight(flapHeight);
        rotateFlap.setPivotY(centerY);

        flapTextFront.setWidth(width);
        flapTextFront.setHeight(flapHeight);

        flapTextBack.setWidth(width);
        flapTextBack.setHeight(flapHeight);

        font = Fonts.latoBold(height * 0.75);

        upperBackgroundTextCtx.setFont(font);
        lowerBackgroundTextCtx.setFont(font);
        flapTextFrontCtx.setFont(font);
        flapTextBackCtx.setFont(font);

        redraw();
    }
78625
function onResize(cm) {
  let d = cm.display
  // Might be a text scaling operation, clear size caches.
  d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null
  d.scrollbarsClipped = false
  cm.setSize()
}
106601
def resizeEvent( self, event ):
        
        super(XLineEdit, self).resizeEvent(event)
        self.adjustButtons()
555164
def resizeEvent(self, event):
        
        self.setUpdatesEnabled(False)
        super(XPopupWidget, self).resizeEvent(event)
        
        self.adjustMask()
        self.setUpdatesEnabled(True)
        
        x = self.width() - self._sizeGrip.width()
        y = self.height() - self._sizeGrip.height()
        
        self._leftSizeGrip.move(0, y)
        self._sizeGrip.move(x, y)
33429
def onresize(self, emitter, width, height):
        
        self._log.debug('App.onresize event occurred. Width:%s Height:%s'%(width, height))
315857
def resizeEvent(self, event):
        
        super(XOverlayWidget, self).resizeEvent(event)
        self.adjustSize()
693858
private void resize() {
        width  = getWidth() - getInsets().getLeft() - getInsets().getRight();
        height = getHeight() - getInsets().getTop() - getInsets().getBottom();
        size   = width < height ? width : height;

        if (width > 0 && height > 0) {
            pane.setMaxSize(size, size);
            pane.setPrefSize(size, size);
            pane.relocate((getWidth() - size) * 0.5, (getHeight() - size) * 0.5);

            segmentPane.setPrefSize(size, size);

            chartCanvas.setWidth(size);
            chartCanvas.setHeight(size);

            centerX = size * 0.5;
            centerY = centerX;

            redraw();
        }
    }
957232
function onResize() {
    const width = window.innerWidth;
    if (width >= 1024) {
      if (!lastSize || lastSize === 'narrow') {
        lastSize = 'wide';

        const expandedState = menu.getAttribute('aria-expanded');
        if (expandedState) {
          menu.setAttribute('data-prev-expanded', expandedState);
        }

        menu.removeAttribute('aria-expanded');
        if (scrim) {
          Classlist(scrim)
            .remove('dqpl-scrim-show')
            .remove('dqpl-scrim-fade-in');
        }

        if (trigger.tabIndex === 0) {
          // since `$trigger` gets hidden (via css hook)
          // "activate" something else in the menubar
          const topBarMenuItems = getTopLevels(topBar.querySelector('[role="menubar"]'), true);
          update(topBarMenuItems);
          topBarMenuItems.forEach((item, i) => item.tabIndex = i === 0 ? 0 : -1);
        }
        menu.setAttribute('data-locked', 'true');
      }
    } else {
      if (!lastSize || lastSize === 'wide') {
        lastSize = 'narrow';
        const wasExpanded = menu.getAttribute('data-prev-expanded') === 'true';
        menu.setAttribute('aria-expanded', wasExpanded ? 'true' : 'false');
        update(getTopLevels(topBar.querySelector('ul'), true));
        menu.setAttribute('data-locked', 'false');

        if (wasExpanded === 'true' && scrim) {
          Classlist(scrim)
            .add('dqpl-scrim-show')
            .add('dqpl-scrim-fade-in');
        }
      }
    }
  }
648724
def resize(self, height, width):
        
        return self.client.api.resize(self.id, height, width)
450754
function resize() {
    var w = $(window).width(), h = $(window).height();
    canvas.attr({ width: w, height: h });
    scene.getCamera().setAspect(w / h);
    renderer.clearViewport();
  }
501266
def resize(self, width, height):
        
        if self.example:
            self.example.resize(width, height)
350382
@Override
	protected void onSizeChanged(int w, int h, int oldw, int oldh) {
		if (w != oldw || h != oldh) {
			mNeedsResize = true;
		}
	}