Package org.eclipse.draw2d.geometry

Examples of org.eclipse.draw2d.geometry.Rectangle.scale()


    double zoom = getZoomLevel();
    int lw = shrinkLines * ((int) (getDeclaration().getPadLineWidth() * zoom));

    Rectangle target = new Rectangle(source.x, source.y, source.width, source.height);
    target.scale(zoom);
    // shrink, but take care not to end up with a negative width or height
    int widthShrink = Math.min(target.width / 2, lw);
    int heightShrink = Math.min(target.height / 2, lw);
    target.shrink(widthShrink, heightShrink);
    return target;
View Full Code Here


    }

    // draw image
    org.eclipse.swt.graphics.Rectangle rect = image.getBounds();
    Rectangle newRect = new Rectangle(0, 0, rect.width, rect.height);
    newRect.scale(getZoomLevel());
    newRect.x = getBounds().x + ((getBounds().width - newRect.width) / 2);
    newRect.y = getBounds().y + ((getBounds().height - newRect.height) / 2);
    graphics.drawImage(image, rect.x, rect.y, rect.width, rect.height, newRect.x, newRect.y, newRect.width, newRect.height);
    image.dispose();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.