From 7424fe24993c3697a51c28b4a861c9c9174d8181 Mon Sep 17 00:00:00 2001 From: Linnea Gräf Date: Tue, 31 Dec 2024 17:13:16 +0100 Subject: fix: Entity viewer in REI --- .../rei/java/moe/nea/firmament/compat/rei/EntityWidget.kt | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'src/compat/rei/java/moe') 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()) -- cgit