Fix circular offset

This commit is contained in:
Karl Pannek 2025-07-19 00:35:21 +02:00
parent 9d74a01f04
commit bce96b0c4a
2 changed files with 12 additions and 2 deletions

View file

@ -222,7 +222,7 @@ function (Parent, KeyboardInput, domController, Settings, Swiper) {
KeyboardAndMouse.prototype.deactivateModifier = function() { KeyboardAndMouse.prototype.deactivateModifier = function() {
this.modifier = false; this.modifier = false;
this.x = this.lastLookDirection * Settings.VIEWPORT_LOOK_AHEAD; this.x = this.lastLookDirection * Settings.VIEWPORT_LOOK_AHEAD;
this.y = 0; this.y = this.y;
this.onXyChange(this.x, this.y); this.onXyChange(this.x, this.y);
this.playerController.deactivateModifier(); this.playerController.deactivateModifier();
}; };

View file

@ -33,6 +33,16 @@ function (Parent, Settings, nc, Layer) {
nc.trigger(nc.ns.client.view.mesh.add, self.layerId, mesh); nc.trigger(nc.ns.client.view.mesh.add, self.layerId, mesh);
} }
// Determine pivot point based on item type
var pivotY;
if (this.options.type === "circle") {
// For circular items, center the pivot
pivotY = this.options.height / 2;
} else {
// For rectangular items, pivot at bottom center
pivotY = this.options.height;
}
nc.trigger(nc.ns.client.view.mesh.create, nc.trigger(nc.ns.client.view.mesh.create,
this.layerId, this.layerId,
texturePath, texturePath,
@ -42,7 +52,7 @@ function (Parent, Settings, nc, Layer) {
height: this.options.height, height: this.options.height,
pivot: { pivot: {
x: this.options.width / 2, x: this.options.width / 2,
y: this.options.height y: pivotY
} }
} }
); );