1
0

fix move speed

This commit is contained in:
2026-02-26 01:46:31 +03:00
parent 6176901ceb
commit fe7e03f756

View File

@@ -120,6 +120,9 @@ namespace DrawFigureLibrary
double scaleX = w / ReferenceWidth;
double scaleY = h / ReferenceHeight;
int refDx = (int)(deltaX / scaleX);
int refDy = (int)(deltaY / scaleY);
var bbox = GetPersonBoundingBox(scaleX, scaleY, _humanDx + deltaX, _humanDy + deltaY);
double maxW = Init.DrawingImage.ActualWidth;
@@ -130,8 +133,8 @@ namespace DrawFigureLibrary
bbox.Right <= maxW &&
bbox.Bottom <= maxH)
{
_humanDx += deltaX;
_humanDy += deltaY;
_humanDx += refDx;
_humanDy += refDy;
}
}
@@ -440,6 +443,9 @@ namespace DrawFigureLibrary
double scaleX = w / ReferenceWidth;
double scaleY = h / ReferenceHeight;
int refDx = (int)(deltaX / scaleX);
int refDy = (int)(deltaY / scaleY);
var bbox = GetPersonBoundingBox(scaleX, scaleY, _humanDx + deltaX, _humanDy + deltaY);
double maxW = Init.DrawingImage.ActualWidth;
@@ -450,8 +456,8 @@ namespace DrawFigureLibrary
bbox.Right <= maxW &&
bbox.Bottom <= maxH)
{
_humanDx += deltaX;
_humanDy += deltaY;
_humanDx += refDx;
_humanDy += refDy;
return true;
}