mirror of
https://github.com/elasota/Aerofoil.git
synced 2025-09-23 23:00:42 +00:00
Revert "Fix some problematic ellipse plotter cases (like 4x36)"
This reverts commit 1d7a75c8a9
.
This commit is contained in:
@@ -73,9 +73,9 @@ namespace PortabilityLayer
|
|||||||
const int32_t xStepCost = -m_xChangeCostDynamicFactor + m_xChangeCostStaticFactor;
|
const int32_t xStepCost = -m_xChangeCostDynamicFactor + m_xChangeCostStaticFactor;
|
||||||
const int32_t yStepCost = m_yChangeCostDynamicFactor + m_yChangeCostStaticFactor;
|
const int32_t yStepCost = m_yChangeCostDynamicFactor + m_yChangeCostStaticFactor;
|
||||||
|
|
||||||
const int32_t tangentCalc = (-m_xChangeCostDynamicFactor) + m_yChangeCostDynamicFactor;
|
const int32_t diagonalCostDelta = xStepCost + yStepCost;
|
||||||
|
|
||||||
if (tangentCalc < 0)
|
if (diagonalCostDelta < 0)
|
||||||
{
|
{
|
||||||
// Diagonal movement will move closer to the edge (first octant)
|
// Diagonal movement will move closer to the edge (first octant)
|
||||||
IncrementY();
|
IncrementY();
|
||||||
@@ -115,9 +115,9 @@ namespace PortabilityLayer
|
|||||||
const int32_t xStepCost = -m_xChangeCostDynamicFactor + m_xChangeCostStaticFactor;
|
const int32_t xStepCost = -m_xChangeCostDynamicFactor + m_xChangeCostStaticFactor;
|
||||||
const int32_t yStepCost = -m_yChangeCostDynamicFactor + m_yChangeCostStaticFactor;
|
const int32_t yStepCost = -m_yChangeCostDynamicFactor + m_yChangeCostStaticFactor;
|
||||||
|
|
||||||
const int32_t tangentCalc = (-m_xChangeCostDynamicFactor) + (-m_yChangeCostDynamicFactor);
|
const int32_t diagonalCostDelta = xStepCost + yStepCost;
|
||||||
|
|
||||||
if (tangentCalc < 0)
|
if (diagonalCostDelta < 0)
|
||||||
{
|
{
|
||||||
// Diagonal movement will move closer to the edge (first octant)
|
// Diagonal movement will move closer to the edge (first octant)
|
||||||
DecrementX();
|
DecrementX();
|
||||||
@@ -157,9 +157,9 @@ namespace PortabilityLayer
|
|||||||
const int32_t xStepCost = m_xChangeCostDynamicFactor + m_xChangeCostStaticFactor;
|
const int32_t xStepCost = m_xChangeCostDynamicFactor + m_xChangeCostStaticFactor;
|
||||||
const int32_t yStepCost = -m_yChangeCostDynamicFactor + m_yChangeCostStaticFactor;
|
const int32_t yStepCost = -m_yChangeCostDynamicFactor + m_yChangeCostStaticFactor;
|
||||||
|
|
||||||
const int32_t tangentCalc = (m_xChangeCostDynamicFactor) + (-m_yChangeCostDynamicFactor);
|
const int32_t diagonalCostDelta = xStepCost + yStepCost;
|
||||||
|
|
||||||
if (tangentCalc < 0)
|
if (diagonalCostDelta < 0)
|
||||||
{
|
{
|
||||||
// Diagonal movement will move closer to the edge (first octant)
|
// Diagonal movement will move closer to the edge (first octant)
|
||||||
DecrementY();
|
DecrementY();
|
||||||
@@ -199,9 +199,9 @@ namespace PortabilityLayer
|
|||||||
const int32_t xStepCost = m_xChangeCostDynamicFactor + m_xChangeCostStaticFactor;
|
const int32_t xStepCost = m_xChangeCostDynamicFactor + m_xChangeCostStaticFactor;
|
||||||
const int32_t yStepCost = m_yChangeCostDynamicFactor + m_yChangeCostStaticFactor;
|
const int32_t yStepCost = m_yChangeCostDynamicFactor + m_yChangeCostStaticFactor;
|
||||||
|
|
||||||
const int32_t tangentCalc = m_xChangeCostDynamicFactor + m_yChangeCostDynamicFactor;
|
const int32_t diagonalCostDelta = xStepCost + yStepCost;
|
||||||
|
|
||||||
if (tangentCalc < 0)
|
if (diagonalCostDelta < 0)
|
||||||
{
|
{
|
||||||
// Diagonal movement will move closer to the edge (first octant)
|
// Diagonal movement will move closer to the edge (first octant)
|
||||||
IncrementX();
|
IncrementX();
|
||||||
|
@@ -1014,15 +1014,9 @@ void DrawSurface::SetSystemFont(int size, int variationFlags)
|
|||||||
|
|
||||||
void DrawSurface::FillEllipse(const Rect &rect)
|
void DrawSurface::FillEllipse(const Rect &rect)
|
||||||
{
|
{
|
||||||
if (!rect.IsValid() || rect.Width() < 1 || rect.Height() < 1)
|
if (!rect.IsValid())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (rect.Width() <= 2 || rect.Height() <= 2)
|
|
||||||
{
|
|
||||||
FillRect(rect);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
PortabilityLayer::ScanlineMask *mask = PortabilityLayer::ScanlineMaskConverter::CompileEllipse(PortabilityLayer::Rect2i(rect.top, rect.left, rect.bottom, rect.right));
|
PortabilityLayer::ScanlineMask *mask = PortabilityLayer::ScanlineMaskConverter::CompileEllipse(PortabilityLayer::Rect2i(rect.top, rect.left, rect.bottom, rect.right));
|
||||||
if (mask)
|
if (mask)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user