Skip to content

Commit

Permalink
Fixed "Bound For" out of width
Browse files Browse the repository at this point in the history
  • Loading branch information
ZiYueCommentary committed Sep 20, 2024
1 parent b62054b commit 013b46d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public void randomDisplayTick2(BlockState state, World world, BlockPos pos, Rand
final double d = (double) pos.getX() + 0.5 + (random.data.nextDouble() - 0.5) * 0.2;
final double e = (double) pos.getY() + 0.4 + (random.data.nextDouble() - 0.5) * 0.2;
final double f = (double) pos.getZ() + 0.5 + (random.data.nextDouble() - 0.5) * 0.2;
float g = random.data.nextBoolean() ? -1 : -5.0f;
float g = random.data.nextBoolean() ? 7 : -5.0f;
final double h = (g /= 16.0f) * (float) direction.getOffsetX();
final double i = g * (float) direction.getOffsetZ();
world.addParticle(new ParticleEffect(DustParticleEffect.BLUE), d + h, e, f + i, 0.0, 0.0, 0.0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -821,7 +821,7 @@ public static NativeImage generateBoundFor(long platformId, HorizontalAlignment
final boolean isTerminating = destinations.isEmpty();
final DynamicTextureCache.Text boundFor;
if (isTerminating) {
boundFor = DynamicTextureCache.instance.getText(IGuiExtension.mergeTranslation("gui.tjmetro.terminus_cjk", "gui.tjmetro.terminus"), width, height, tileSize * 3 / 5, tileSize * 3 / 10, padding, horizontalAlignment, forceMTRFont);
boundFor = DynamicTextureCache.instance.getText(IGuiExtension.mergeTranslation("gui.tjmetro.terminus_cjk", "gui.tjmetro.terminus"), width - padding * 2, height, tileSize * 3 / 5, tileSize * 3 / 10, padding, horizontalAlignment, forceMTRFont);
} else {
String destinationString = IGui.mergeStations(destinations);
final boolean isClockwise = destinationString.startsWith(TEMP_CIRCULAR_MARKER_CLOCKWISE);
Expand All @@ -836,7 +836,7 @@ public static NativeImage generateBoundFor(long platformId, HorizontalAlignment
destinationString = IGuiExtension.insertTranslation("gui.tjmetro.bound_for_cjk", "gui.tjmetro.bound_for", 1, destinationString);
}
}
boundFor = DynamicTextureCache.instance.getText(destinationString, width, height, tileSize * 3 / 5, tileSize * 3 / 10, padding, horizontalAlignment, forceMTRFont);
boundFor = DynamicTextureCache.instance.getText(destinationString, width - padding * 2, height, tileSize * 3 / 5, tileSize * 3 / 10, padding, horizontalAlignment, forceMTRFont);
}

final NativeImage nativeImage = new NativeImage(NativeImageFormat.RGBA, width, height, false);
Expand Down

0 comments on commit 013b46d

Please sign in to comment.