Closed zmoth closed 1 year ago
hi @paceholder , do you think it is necessary to design struct ScaleRange
in this way?
struct ScaleRange
{
ScaleRange(double minimum = 0, double maximum = 0);
double minimum, maximum = 0;
void operator=(ScaleRange const& r);
void sort();
};
GraphicsView::ScaleRange::
ScaleRange(double minimum, double maximum)
:minimum(minimum), maximum(maximum)
{
sort();
}
void
GraphicsView::ScaleRange::
operator=(ScaleRange const& r)
{
minimum = r.minimum;
maximum = r.maximum;
sort();
}
void
GraphicsView::ScaleRange::
sort()
{
minimum = minimum < 0 ? 0 : minimum;
maximum = maximum < 0 ? 0 : maximum;
if (minimum > maximum)
{
double tmp = minimum;
minimum = maximum;
maximum = tmp;
}
}
I manually merged your code with small fixes:
master
Thanks for the contribution
I manually merged your code with small fixes:
- code styling
- removed multiple merge commits
- made a single squashed commit, rebased it onto the lates
master
Thanks for the contribution
Thank you for your help. I will learn from your code and improve myself.
I hope to have .clang-format as soon as possible
setupScale