Skip to content

Commit

Permalink
Merge pull request #94 from RPTools/1.4.0-dev
Browse files Browse the repository at this point in the history
1.4.0 dev
  • Loading branch information
cwisniew authored Jun 12, 2016
2 parents 66cdbdf + 80408a3 commit 0de3a33
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1950,6 +1950,7 @@ protected void renderMoveSelectionSets(Graphics2D g, PlayerView view, Set<Select
double th = token.getHeight() * Double.valueOf(footprintBounds.width) / token.getWidth();
iso_ho = footprintBounds.height - th;
footprintBounds = new Rectangle(footprintBounds.x, footprintBounds.y - (int) iso_ho, footprintBounds.width, (int) th);
iso_ho = iso_ho * getScale();
}
SwingUtil.constrainTo(imgSize, footprintBounds.width, footprintBounds.height);

Expand All @@ -1958,7 +1959,6 @@ protected void renderMoveSelectionSets(Graphics2D g, PlayerView view, Set<Select
if (token.isSnapToScale()) {
offsetx = (int) (imgSize.width < footprintBounds.width ? (footprintBounds.width - imgSize.width) / 2 * getScale() : 0);
offsety = (int) (imgSize.height < footprintBounds.height ? (footprintBounds.height - imgSize.height) / 2 * getScale() : 0);
iso_ho = iso_ho * getScale();
}
int tx = x + offsetx;
int ty = y + offsety + (int) iso_ho;
Expand All @@ -1973,7 +1973,11 @@ protected void renderMoveSelectionSets(Graphics2D g, PlayerView view, Set<Select
at.scale((double) imgSize.width / workImage.getWidth(), (double) imgSize.height / workImage.getHeight());
at.scale(getScale(), getScale());
} else {
at.scale((double) scaledWidth / workImage.getWidth(), (double) scaledHeight / workImage.getHeight());
if (token.getShape() == TokenShape.FIGURE) {
at.scale((double) scaledWidth / workImage.getWidth(), (double) scaledWidth / workImage.getWidth());
} else {
at.scale((double) scaledWidth / workImage.getWidth(), (double) scaledHeight / workImage.getHeight());
}
}
g.drawImage(workImage, at, this);

Expand Down Expand Up @@ -2617,7 +2621,11 @@ protected void renderTokens(Graphics2D g, List<Token> tokenList, PlayerView view
at.scale(((double) imgSize.width) / workImage.getWidth(), ((double) imgSize.height) / workImage.getHeight());
at.scale(getScale(), getScale());
} else {
at.scale((scaledWidth) / workImage.getWidth(), (scaledHeight) / workImage.getHeight());
if (token.getShape() == TokenShape.FIGURE) {
at.scale((double) scaledWidth / workImage.getWidth(), (double) scaledWidth / workImage.getWidth());
} else {
at.scale((double) scaledWidth / workImage.getWidth(), (double) scaledHeight / workImage.getHeight());
}
}
timer.stop("tokenlist-6");

Expand Down
12 changes: 8 additions & 4 deletions maptool/src/main/java/net/rptools/maptool/model/Zone.java
Original file line number Diff line number Diff line change
Expand Up @@ -1386,10 +1386,10 @@ public int compare(Token o1, Token o2) {
* if either token is a figure, get the footprint and find the lowest point but if the same,
* return the smallest, else use normal z order
*/
Rectangle b1 = o1.getFootprint(getGrid()).getBounds(getGrid());
Rectangle b2 = o2.getFootprint(getGrid()).getBounds(getGrid());
int v1 = o1.getY() + b1.y + b1.height;
int v2 = o2.getY() + b2.y + b2.height;
Rectangle b1 = o1.getBounds(getZone());
Rectangle b2 = o2.getBounds(getZone());
int v1 = o1.getY() + b1.height;
int v2 = o2.getY() + b2.height;
if ((v1 - v2) != 0)
return v1 - v2;
if (o1.isStamp() && o2.isToken())
Expand All @@ -1413,6 +1413,10 @@ public int compare(Token o1, Token o2) {
};
}

private Zone getZone() {
return this;
}

/** @return Getter for initiativeList */
public InitiativeList getInitiativeList() {
return initiativeList;
Expand Down

0 comments on commit 0de3a33

Please sign in to comment.