aboutsummaryrefslogtreecommitdiff
path: root/src/compat/rei/java/moe
diff options
context:
space:
mode:
authorLinnea Gräf <nea@nea.moe>2024-12-31 17:13:16 +0100
committerLinnea Gräf <nea@nea.moe>2024-12-31 17:13:16 +0100
commit7424fe24993c3697a51c28b4a861c9c9174d8181 (patch)
tree0dfc8d4ee6cd57024039ae7cd4c6f31247925d28 /src/compat/rei/java/moe
parenta892a5f90b87b530331a7652dd4eb5bc07bf1c03 (diff)
downloadFirmament-7424fe24993c3697a51c28b4a861c9c9174d8181.tar.gz
Firmament-7424fe24993c3697a51c28b4a861c9c9174d8181.tar.bz2
Firmament-7424fe24993c3697a51c28b4a861c9c9174d8181.zip
fix: Entity viewer in REI
Diffstat (limited to 'src/compat/rei/java/moe')
-rw-r--r--src/compat/rei/java/moe/nea/firmament/compat/rei/EntityWidget.kt13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/compat/rei/java/moe/nea/firmament/compat/rei/EntityWidget.kt b/src/compat/rei/java/moe/nea/firmament/compat/rei/EntityWidget.kt
index 2b9e4bf..1097654 100644
--- a/src/compat/rei/java/moe/nea/firmament/compat/rei/EntityWidget.kt
+++ b/src/compat/rei/java/moe/nea/firmament/compat/rei/EntityWidget.kt
@@ -25,24 +25,19 @@ class EntityWidget(
override fun render(context: DrawContext, mouseX: Int, mouseY: Int, delta: Float) {
try {
- context.matrices.push()
if (!hasErrored) {
- context.matrices.translate(point.x.toDouble(), point.y.toDouble(), 0.0)
- val xScale = size.width / defaultSize.width.toDouble()
- val yScale = size.height / defaultSize.height.toDouble()
- context.matrices.scale(xScale.toFloat(), yScale.toFloat(), 1.0F)
EntityRenderer.renderEntity(
entity!!,
context,
- 0, 0,
- (mouseX - point.x) * xScale,
- (mouseY - point.y) * yScale)
+ point.x, point.y,
+ size.width, size.height,
+ mouseX.toDouble(),
+ mouseY.toDouble())
}
} catch (ex: Exception) {
ErrorUtil.softError("Failed to render constructed entity: $entity", ex)
hasErrored = true
} finally {
- context.matrices.pop()
}
if (hasErrored) {
context.fill(point.x, point.y, point.x + size.width.toInt(), point.y + size.height.toInt(), 0xFFAA2222.toInt())