Docker-in-Docker (DinD) capabilities of public runners deactivated. More info

Commit 656d64f3 authored by Grégoire Uhlrich's avatar Grégoire Uhlrich
Browse files

GRAFED curvature adapted int -> double

parent 43530fa4
...@@ -128,14 +128,16 @@ qreal Edge::getCurvature() const ...@@ -128,14 +128,16 @@ qreal Edge::getCurvature() const
void Edge::setCurvature(double t_curvature) void Edge::setCurvature(double t_curvature)
{ {
double max = 1.99; double max = 2;
double step = 1/50.; bool less = std::fabs(2*t_curvature) < std::fabs(curvature);
curvature = 2*t_curvature; curvature = 2*t_curvature;
if (curvature > max) if (curvature > max)
curvature = max; curvature = max;
else if (curvature < -max) else if (curvature < -max)
curvature = -max; curvature = -max;
if (std::abs(curvature) < 0.33*step*max) if (less && std::fabs(curvature) < 0.1)
curvature = 0;
else if (std::fabs(curvature) < 0.01)
curvature = 0; curvature = 0;
graph->renderer->modificationDone(); graph->renderer->modificationDone();
update(); update();
...@@ -689,9 +691,8 @@ void Edge::mouseDoubleClickEvent(QGraphicsSceneMouseEvent */*event*/) ...@@ -689,9 +691,8 @@ void Edge::mouseDoubleClickEvent(QGraphicsSceneMouseEvent */*event*/)
void Edge::wheelEventCustom(int delta) void Edge::wheelEventCustom(int delta)
{ {
if (hasFocusInGraph()) { if (hasFocusInGraph()) {
double max = 1.99; double step = 0.002 * 1 / (1 + std::pow(std::fabs(curvature), 2));
double step = 0.05; setCurvature((curvature + delta * step)/2);
setCurvature((curvature + delta / std::abs(delta) * step*max)/2);
if (label and label->data != "") if (label and label->data != "")
setName(label->data); setName(label->data);
scene()->update(); scene()->update();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment