Closed v3921358 closed 1 month ago
I noticed there are two problems about it
we didn't really change about the node value
PointF pointXY = img.Value.Item2.GetCanvasOriginPosition(); if (pointXY != null && pointXY.X != 0 && pointXY.Y != 0) { pointXY.X *= (SCALE_UP_FACTOR * downscaleFactorAfter); // 4 * 0.25 = 1, 4 * 0.5 = 2 pointXY.Y *= (SCALE_UP_FACTOR * downscaleFactorAfter); }
The reason is what we changed is a copy
public PointF GetCanvasOriginPosition() { WzVectorProperty originPos = (WzVectorProperty)this[OriginPropertyName]; if (originPos != null) return new PointF(originPos.X.Value, originPos.Y.Value); return new PointF(0, 0); }
we should change all vector nodes that the level is under the canvas property, it might looks like this
public const string OriginPropertyName = "origin"; public const string HeadPropertyName = "head"; public const string LtPropertyName = "lt"; public const string RbPropertyName = "rb"; public void UpdateCanvasPositionRate(double rate) { string[] vectorProperties = { OriginPropertyName, HeadPropertyName, LtPropertyName, RbPropertyName }; foreach (var property in vectorProperties) { var vectorProperty = (WzVectorProperty)this[property]; if (vectorProperty != null) { vectorProperty.X.Value = (int)(vectorProperty.X.Value * rate); vectorProperty.Y.Value = (int)(vectorProperty.Y.Value * rate); } } }
Missed that, thanks for pointing it out.
https://github.com/lastbattle/Harepacker-resurrected/commit/496e4e1b9c371fff80eb01a207709f7e6835786b https://github.com/lastbattle/MapleLib/commit/27e89f78cd913c5feb2fafd53d46b59b26e9a996
I noticed there are two problems about it
we didn't really change about the node value
The reason is what we changed is a copy
we should change all vector nodes that the level is under the canvas property, it might looks like this