#9 another Method for PDRectangle

closed-fixed
nobody
None
5
2005-08-16
2005-08-12
No

Hi Ben,

i wrote a short 4liner which is sometimes pretty
useful. If you think it would fit into the Class please
feel free to add it to
org.pdfbox.pdmodel.common.PDRectangle

I tested it with a PDPushbutton an a PDTextbox and
should work with every other too.

Thanks again for you great work ;)

/**
* This will move the rectangle the given relative amount
*
* @param horizontalAmount positive values will move
rectangle to the right, negative's to the left.
* @param verticalAmount positive values will move the
rectangle up, negative's down.
*
*/
public void move(float horizontalAmount, float
verticalAmount) {
setUpperRightX(getUpperRightX() + horizontalAmount);
setLowerLeftX(getLowerLeftX() + horizontalAmount);
setUpperRightY(getUpperRightY() + verticalAmount);
setLowerLeftY(getLowerLeftY() + verticalAmount);
}

Michael

Discussion

  • Ben Litchfield
    Ben Litchfield
    2005-08-16

    • status: open --> closed-fixed
     
  • Ben Litchfield
    Ben Litchfield
    2005-08-16

    Logged In: YES
    user_id=601708

    Added to CVS!

    Ben Litchfield