fix move speed
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user