juce::Rectangle – Memo –

set*

setSize()

setSize()

    yellowRect.setSize (100, 200);

setBounds()

setBounds()

    yellowRect.setBounds (90, 100, 100, 100);

setX()

setX()

    yellowRect.setX (50);

setY()

setY()

    yellowRect.setY (20);

setTop()

setTop()

    yellowRect.setTop (150);

setBottom()

setBottom()

    yellowRect.setBottom (150);

setLeft()

setLeft()

    yellowRect.setLeft (150);

setRight()

setRight()

    yellowRect.setRight (150);

setCentre()

setCentre()

    yellowRect.setCentre (280, 150);

setHorizontalRange()

setHorizontalRange()

    yellowRect.setHorizontalRange (juce::Range<int> (40, 200));

setVerticalRange()

setVerticalRange()

    yellowRect.setVerticalRange (juce::Range<int> (60, 250));

reduce/expand

reduce()

reduce()

    yellowRect.reduce (20, 50);

expand()

expand()

    yellowRect.expand (30, 40);

reduced()

reduced()

    auto greenRect = blueRect.reduced (50, 30);

expanded()

expanded()

    auto greenRect = blueRect.expanded (50, 30);

with*

withX()

withX()

    auto greenRect = blueRect.withX (20);

withY()

withY()

    auto greenRect = blueRect.withY (50);

withRightX()

withRightX()

    auto greenRect = blueRect.withRightX (80);

withRight()

withRight()

    auto greenRect = blueRect.withRight (80);

withBottomY()

withBottomY()

    auto greenRect = blueRect.withBottomY (250);

withBottom()

withBottom()

    auto greenRect = blueRect.withBottom (250);

withLeft()

withLeft()

    auto greenRect = blueRect.withLeft (150);

withTop()

withTop()

    auto greenRect = blueRect.withTop (150);

withPosition()

withPosition()

    auto greenRect = blueRect.withPosition (100, 100);

withZeroOrigin()

withZeroOrigin()

    auto greenRect = blueRect.withZeroOrigin();

withCentre()

withCentre()

    auto greenRect = blueRect.withCentre (juce::Point<int> (200, 250));

withWidth()

withWidth()

    auto greenRect = blueRect.withWidth (100);

withHeight()

withHeight()

    auto greenRect = blueRect.withHeight (100);

withSize()

withSize()

    auto greenRect = blueRect.withSize (100, 100);

withSizeKeepingCentre()

withSizeKeepingCentre()

    auto greenRect = blueRect.withSizeKeepingCentre (50, 50);

withTrimmedTop()

withTrimmedTop()

    auto greenRect = blueRect.withTrimmedTop (100);

withTrimmedBottom()

withTrimmedBottom()

    auto greenRect = blueRect.withTrimmedBottom (100);

withTrimmedLeft()

withTrimmedLeft()

    auto greenRect = blueRect.withTrimmedLeft (100);

withTrimmedRight()

withTrimmedRight()

    auto greenRect = blueRect.withTrimmedRight (100);

removeFrom*

removeFromTop()

removeFromTop()

    auto greenRect = blueRect.removeFromTop (50);

removeFromBottom()

removeFromBottom()

    auto greenRect = blueRect.removeFromBottom (50);

removeFromLeft()

removeFromLeft()

    auto greenRect = blueRect.removeFromLeft (50);

removeFromRight()

removeFromRight()

    auto greenRect = blueRect.removeFromRight (50);

Comments

Copied title and URL