Fix crash when setting graph options to very large numbers (#904)

* fix crash

* Fixes

* Update build/pipelines/templates/build-app-internal.yaml

Co-Authored-By: Stephanie Anderl <46726333+sanderl@users.noreply.github.com>

Co-authored-by: Stephanie Anderl <46726333+sanderl@users.noreply.github.com>
This commit is contained in:
Pepe Rivera 2020-01-08 15:06:26 -08:00 committed by Stephanie Anderl
parent c3414ea9c9
commit 9329af37f1
4 changed files with 33 additions and 8 deletions

View File

@ -29,7 +29,7 @@ jobs:
downloadDirectory: $(Build.SourcesDirectory) downloadDirectory: $(Build.SourcesDirectory)
vstsFeed: WindowsApps vstsFeed: WindowsApps
vstsFeedPackage: calculator-internals vstsFeedPackage: calculator-internals
vstsPackageVersion: 0.0.31 vstsPackageVersion: 0.0.33
- template: ./build-single-architecture.yaml - template: ./build-single-architecture.yaml
parameters: parameters:

View File

@ -179,10 +179,19 @@ namespace GraphControl::DX
int formulaId = -1; int formulaId = -1;
float nearestPointLocationX, nearestPointLocationY; float nearestPointLocationX, nearestPointLocationY;
float nearestPointValueX, nearestPointValueY; double nearestPointValueX, nearestPointValueY, rhoValueOut, thetaValueOut, tValueOut;
if (renderer->GetClosePointData( if (renderer->GetClosePointData(
trackPoint.X, trackPoint.Y, formulaId, nearestPointLocationX, nearestPointLocationY, nearestPointValueX, nearestPointValueY) trackPoint.X,
trackPoint.Y,
formulaId,
nearestPointLocationX,
nearestPointLocationY,
nearestPointValueX,
nearestPointValueY,
rhoValueOut,
thetaValueOut,
tValueOut)
== S_OK) == S_OK)
{ {
if (!isnan(nearestPointLocationX) && !isnan(nearestPointLocationY)) if (!isnan(nearestPointLocationX) && !isnan(nearestPointLocationY))

View File

@ -38,19 +38,25 @@ namespace MockGraphingImpl
} }
virtual HRESULT GetClosePointData( virtual HRESULT GetClosePointData(
float inScreenPointX, double inScreenPointX,
float inScreenPointY, double inScreenPointY,
int& formulaIdOut, int& formulaIdOut,
float& xScreenPointOut, float& xScreenPointOut,
float& yScreenPointOut, float& yScreenPointOut,
float& xValueOut, double& xValueOut,
float& yValueOut) double& yValueOut,
double& rhoValueOut,
double& thetaValueOut,
double& tValueOut)
{ {
formulaIdOut = 0; formulaIdOut = 0;
xScreenPointOut = 0; xScreenPointOut = 0;
yScreenPointOut = 0; yScreenPointOut = 0;
xValueOut = 0; xValueOut = 0;
yValueOut = 0; yValueOut = 0;
rhoValueOut = 0;
thetaValueOut = 0;
tValueOut = 0;
return S_OK; return S_OK;
} }

View File

@ -23,7 +23,17 @@ namespace Graphing::Renderer
virtual HRESULT SetDpi(float dpiX, float dpiY) = 0; virtual HRESULT SetDpi(float dpiX, float dpiY) = 0;
virtual HRESULT DrawD2D1(ID2D1Factory* pDirect2dFactory, ID2D1RenderTarget* pRenderTarget, bool& hasSomeMissingDataOut) = 0; virtual HRESULT DrawD2D1(ID2D1Factory* pDirect2dFactory, ID2D1RenderTarget* pRenderTarget, bool& hasSomeMissingDataOut) = 0;
virtual HRESULT GetClosePointData(float inScreenPointX, float inScreenPointY, int& formulaIdOut, float& xScreenPointOut, float& yScreenPointOut, float& xValueOut, float& yValueOut) = 0; virtual HRESULT GetClosePointData(
double inScreenPointX,
double inScreenPointY,
int& formulaIdOut,
float& xScreenPointOut,
float& yScreenPointOut,
double& xValueOut,
double& yValueOut,
double& rhoValueOut,
double& thetaValueOut,
double& tValueOut) = 0;
virtual HRESULT ScaleRange(double centerX, double centerY, double scale) = 0; virtual HRESULT ScaleRange(double centerX, double centerY, double scale) = 0;
virtual HRESULT ChangeRange(ChangeRangeAction action) = 0; virtual HRESULT ChangeRange(ChangeRangeAction action) = 0;