Fixed "Rendering of circles" for Ticket #85

presentation
Andreas Butti 11 years ago
parent 5844a2ee9f
commit f44b452678
  1. 25
      src/control/ToolHandler.cpp
  2. 7
      src/control/tools/InputHandler.cpp

@ -252,7 +252,12 @@ void ToolHandler::setRuler(bool ruler, bool disableOthers)
{
XOJ_CHECK_TYPE(ToolHandler);
if (ruler && disableOthers) setAll(false);
if (ruler && disableOthers)
{
setAll(false);
}
this->current->ruler = ruler;
}
@ -260,7 +265,11 @@ void ToolHandler::setRectangle(bool rectangle, bool disableOthers)
{
XOJ_CHECK_TYPE(ToolHandler);
if (rectangle && disableOthers) setAll(false);
if (rectangle && disableOthers)
{
setAll(false);
}
this->current->rectangle = rectangle;
}
@ -268,7 +277,11 @@ void ToolHandler::setCircle(bool circle, bool disableOthers)
{
XOJ_CHECK_TYPE(ToolHandler);
if (circle && disableOthers) setAll(false);
if (circle && disableOthers)
{
setAll(false);
}
this->current->circle = circle;
}
@ -276,7 +289,11 @@ void ToolHandler::setArrow(bool arrow, bool disableOthers)
{
XOJ_CHECK_TYPE(ToolHandler);
if (arrow && disableOthers) setAll(false);
if (arrow && disableOthers)
{
setAll(false);
}
this->current->arrow = arrow;
}

@ -131,15 +131,14 @@ void InputHandler::addPointToTmpStroke(GdkEventMotion* event)
Point p = tmpStroke->getPoint(0);
//set resolution proportional to radius
double diameter = sqrt(pow(x - p.x, 2.0) + pow(y - p.y, 2.0));
int npts = (int) (diameter / 2.0);
int npts = (int) (diameter * 2.0);
double center_x = (x + p.x) / 2.0;
double center_y = (y + p.y) / 2.0;
double angle = atan2((y - p.y), (x - p.x));
if (npts < 12)
if (npts < 24)
{
npts = 12; // min. number of points
npts = 24; // min. number of points
}
//remove previous points

Loading…
Cancel
Save