1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-17 02:52:12 +01:00

OP37/GCS MapLib - Fixed drag with digital zooming, enhanced graphics quality

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1735 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
zedamota 2010-09-24 19:28:40 +00:00 committed by zedamota
parent d9b890791c
commit fa4818542e

View File

@ -154,6 +154,9 @@ namespace mapcontrol
transform.scale(MapRenderTransform,MapRenderTransform);
painter->setWorldTransform(transform);
painter->setRenderHint(QPainter::SmoothPixmapTransform,true);
painter->setRenderHint(QPainter::HighQualityAntialiasing,true);
{
DrawMap2D(painter);
}
@ -168,9 +171,20 @@ namespace mapcontrol
{
if(core->IsDragging())
{
core->mouseCurrent.SetX(event->pos().x());
core->mouseCurrent.SetY(event->pos().y());
if(MapRenderTransform!=1)
{
qreal dx= (event->pos().x()-core->mouseDown.X())/(MapRenderTransform);
qreal dy= (event->pos().y()-core->mouseDown.Y())/(MapRenderTransform);
qreal nx=core->mouseDown.X()+dx;
qreal ny=core->mouseDown.Y()+dy;
core->mouseCurrent.SetX(nx);
core->mouseCurrent.SetY(ny);
}
else
{
core->mouseCurrent.SetX(event->pos().x());
core->mouseCurrent.SetY(event->pos().y());
}
{
core->Drag(core->mouseCurrent);
}
@ -198,23 +212,23 @@ namespace mapcontrol
if(!IsMouseOverMarker())
if(!IsMouseOverMarker())
{
if(event->button() == config->DragButton && CanDragMap()&& !((event->modifiers()==Qt::AltModifier)||(event->modifiers()==Qt::ShiftModifier)))
{
if(event->button() == config->DragButton && CanDragMap()&& !((event->modifiers()==Qt::AltModifier)||(event->modifiers()==Qt::ShiftModifier)))
{
core->mouseDown.SetX(event->pos().x());
core->mouseDown.SetY(event->pos().y());
core->mouseDown.SetX(event->pos().x());
core->mouseDown.SetY(event->pos().y());
this->setCursor(Qt::SizeAllCursor);
this->setCursor(Qt::SizeAllCursor);
core->BeginDrag(core->mouseDown);
this->update();
core->BeginDrag(core->mouseDown);
this->update();
}
else if(!isSelected && ((event->modifiers()==Qt::AltModifier)||(event->modifiers()==Qt::ShiftModifier)))
{
isSelected = true;
}
else if(!isSelected && ((event->modifiers()==Qt::AltModifier)||(event->modifiers()==Qt::ShiftModifier)))
{
isSelected = true;
SetSelectedArea (internals::RectLatLng::Empty);
selectionEnd = internals::PointLatLng::Empty;
selectionStart = FromLocalToLatLng(event->pos().x(), event->pos().y());