Merge pull request #504 from teyrana/fix_502_rocketfigure_bounds

[fixes #502] Adjust RocketFigure Bounds
This commit is contained in:
Wes Cravens 2019-01-02 16:52:07 -06:00 committed by GitHub
commit 02031680d9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -371,7 +371,6 @@ public class FinPointFigure extends AbstractScaleFigure {
final int finFrontX = (int)(subjectBounds_m.getX()*scale);
final int subjectHeight = (int)(subjectBounds_m.getHeight()*scale);
// the negative sign is to compensate for the mount's negative location.
originLocation_px.width = borderThickness_px.width - finFrontX;
if( visibleBounds_px.height > (subjectHeight+ 2*borderThickness_px.height)) {

View File

@ -474,6 +474,7 @@ public class RocketFigure extends AbstractScaleFigure {
*/
@Override
protected void updateCanvasOrigin() {
final int subjectFront = (int)(subjectBounds_m.getMinX()*scale);
final int subjectWidth = (int)(subjectBounds_m.getWidth()*scale);
final int subjectHeight = (int)(subjectBounds_m.getHeight()*scale);
@ -483,7 +484,7 @@ public class RocketFigure extends AbstractScaleFigure {
originLocation_px = new Dimension(newOriginX, newOriginY);
}else if (currentViewType == RocketPanel.VIEW_TYPE.SideView){
final int newOriginX = borderThickness_px.width;
final int newOriginX = borderThickness_px.width - subjectFront;
final int newOriginY = Math.max(getHeight(), subjectHeight + 2*borderThickness_px.height )/ 2;
originLocation_px = new Dimension(newOriginX, newOriginY);