Fixing locating points outside the periodic domain

This commit is contained in:
Nico Kruithof 2013-01-25 17:37:11 +01:00
parent b8babf5964
commit fa1b7493f0
1 changed files with 4 additions and 0 deletions

View File

@ -55,6 +55,10 @@ void
TriangulationPointInputAndConflictZone<T>::mousePressEvent(QGraphicsSceneMouseEvent *event)
{
p = convert(event->scenePos());
double dx = dt->domain().xmax() - dt->domain().xmin();
double dy = dt->domain().ymax() - dt->domain().ymin();
p = Point(p.x()- std::floor(p.x()/dx), p.y()- std::floor(p.y()/dy));
if(dt->dimension() < 2 ||
event->modifiers() != 0 ||
event->button() != ::Qt::LeftButton) {