Allow line style to be changed (#1097)
* add line style * start line style * More fixes * undo key * more tweaks * address comments * Fix merge
This commit is contained in:
@@ -558,13 +558,14 @@ namespace GraphControl
|
||||
auto lineColor = eq->LineColor;
|
||||
graphColors.emplace_back(lineColor.R, lineColor.G, lineColor.B, lineColor.A);
|
||||
|
||||
if (eq->GraphedEquation)
|
||||
if (eq->GraphedEquation)
|
||||
{
|
||||
if (!eq->HasGraphError && eq->IsSelected)
|
||||
{
|
||||
eq->GraphedEquation->TrySelectEquation();
|
||||
}
|
||||
|
||||
eq->GraphedEquation->GetGraphEquationOptions()->SetLineStyle(static_cast<::Graphing::Renderer::LineStyle>(eq->EquationStyle));
|
||||
eq->GraphedEquation->GetGraphEquationOptions()->SetLineWidth(LineWidth);
|
||||
eq->GraphedEquation->GetGraphEquationOptions()->SetSelectedEquationLineWidth(LineWidth + ((LineWidth <= 2) ? 1 : 2));
|
||||
}
|
||||
|
@@ -26,6 +26,7 @@ namespace GraphControl
|
||||
{
|
||||
wstring request;
|
||||
wstring_view expr{ Expression->Data() };
|
||||
IsInequality = false;
|
||||
|
||||
// Check for unicode characters of less than, less than or equal to, greater than and greater than or equal to.
|
||||
if (expr.find(L">><") != wstring_view::npos || expr.find(L"><<") != wstring_view::npos || expr.find(L">≥<") != wstring_view::npos
|
||||
@@ -33,6 +34,8 @@ namespace GraphControl
|
||||
|| expr.find(L"><<") != wstring_view::npos || expr.find(L">><") != wstring_view::npos)
|
||||
{
|
||||
request = L"<mrow><mi>plotIneq2D</mi><mfenced separators=\"\">";
|
||||
IsInequality = true;
|
||||
EquationStyle = EquationLineStyle::Dash;
|
||||
}
|
||||
else if (expr.find(L">=<") != wstring_view::npos)
|
||||
{
|
||||
|
@@ -7,6 +7,16 @@
|
||||
|
||||
namespace GraphControl
|
||||
{
|
||||
public
|
||||
enum class EquationLineStyle : int
|
||||
{
|
||||
Solid,
|
||||
Dot,
|
||||
Dash,
|
||||
DashDot,
|
||||
DashDotDot
|
||||
};
|
||||
|
||||
public enum class ErrorType
|
||||
{
|
||||
Evaluation,
|
||||
@@ -211,7 +221,9 @@ namespace GraphControl
|
||||
OBSERVABLE_NAMED_PROPERTY_RW(bool, IsLineEnabled);
|
||||
OBSERVABLE_NAMED_PROPERTY_RW(bool, IsValidated);
|
||||
OBSERVABLE_NAMED_PROPERTY_RW(bool, HasGraphError);
|
||||
OBSERVABLE_NAMED_PROPERTY_RW(bool, IsInequality);
|
||||
OBSERVABLE_NAMED_PROPERTY_RW(bool, IsSelected);
|
||||
OBSERVABLE_NAMED_PROPERTY_RW(EquationLineStyle, EquationStyle);
|
||||
OBSERVABLE_NAMED_PROPERTY_RW(ErrorType, GraphErrorType);
|
||||
OBSERVABLE_NAMED_PROPERTY_RW(int, GraphErrorCode);
|
||||
|
||||
@@ -221,12 +233,10 @@ namespace GraphControl
|
||||
void set(Windows::UI::Color value);
|
||||
}
|
||||
|
||||
static property Platform::String
|
||||
^ LineColorPropertyName { Platform::String ^ get(); }
|
||||
|
||||
public : Platform::String
|
||||
^ GetRequest();
|
||||
static property Platform::String ^ LineColorPropertyName { Platform::String ^ get(); }
|
||||
|
||||
public:
|
||||
Platform::String ^ GetRequest();
|
||||
bool IsGraphableEquation();
|
||||
|
||||
internal:
|
||||
|
@@ -158,7 +158,7 @@ public
|
||||
{
|
||||
auto equation = static_cast<Equation ^>(sender);
|
||||
auto propertyName = args->PropertyName;
|
||||
if (propertyName == GraphControl::Equation::LineColorPropertyName || propertyName == GraphControl::Equation::IsSelectedPropertyName)
|
||||
if (propertyName == GraphControl::Equation::LineColorPropertyName || propertyName == GraphControl::Equation::IsSelectedPropertyName || propertyName == GraphControl::Equation::EquationStylePropertyName)
|
||||
{
|
||||
EquationStyleChanged(equation);
|
||||
}
|
||||
|
Reference in New Issue
Block a user