corrected zoom in

This commit is contained in:
yikestone 2019-12-09 15:06:27 +05:30
parent e4629f0e6f
commit 5f0a934526
3 changed files with 16 additions and 15 deletions

Binary file not shown.

View File

@ -4,6 +4,5 @@
<file>shaders/blink.vert</file>
<file>shaders/map.vert</file>
<file>shaders/map.frag</file>
<file>playground.pgm</file>
</qresource>
</RCC>

View File

@ -66,24 +66,27 @@ void Speller::classify(int len, struct insight_data *buf) {
void Speller::reconfigure_map(int result, int shape) {
int w = area_displayed->width();
int h = area_displayed->height();
int x = area_displayed->x();
int y = area_displayed->y();
switch (shape) {
case SQUARE:
switch (result) {
case TOP_LEFT:
area_displayed->setWidth(w / 1.9);
area_displayed->setY(h * 0.9 / 1.9);
area_displayed->setWidth(w / 1.8);
area_displayed->setY(y + h / 1.8);
break;
case TOP_RIGHT:
area_displayed->setX(w * 0.9 / 1.9);
area_displayed->setY(h * 0.9 / 1.9);
area_displayed->setX(x + w / 1.8);
area_displayed->setY(y + h / 1.8);
break;
case BOTTOM_LEFT:
area_displayed->setHeight(h / 1.9);
area_displayed->setWidth(w / 1.9);
area_displayed->setHeight(h / 1.8);
area_displayed->setWidth(w / 1.8);
break;
case BOTTOM_RIGHT:
area_displayed->setHeight(h / 1.9);
area_displayed->setX(w * 0.9 / 1.9);
area_displayed->setHeight(h / 1.8);
area_displayed->setX(x + w / 1.8);
break;
}
break;
@ -91,11 +94,11 @@ void Speller::reconfigure_map(int result, int shape) {
switch (result) {
case TOP_LEFT:
case BOTTOM_LEFT:
area_displayed->setWidth(w / 1.9);
area_displayed->setWidth(w / 1.8);
break;
case TOP_RIGHT:
case BOTTOM_RIGHT:
area_displayed->setX(w * 0.9 / 1.9);
area_displayed->setX(x + w / 1.8);
break;
}
break;
@ -103,11 +106,11 @@ void Speller::reconfigure_map(int result, int shape) {
switch (result) {
case TOP_LEFT:
case TOP_RIGHT:
area_displayed->setY(h * 0.9 / 1.9);
area_displayed->setY(h + h / 1.8);
break;
case BOTTOM_LEFT:
case BOTTOM_RIGHT:
area_displayed->setHeight(h / 1.9);
area_displayed->setHeight(h / 1.8);
break;
}
break;
@ -190,8 +193,7 @@ __inline__ void Speller::init_ros() {
}
curr_map = new QImage(map_tex_buffer, map.info.width, map.info.height,
3 * map.info.width, QImage::Format_RGB888);
area_displayed = new QRect(QPoint(0, 0), QSize(curr_map->size().height() / 2,
curr_map->size().width()));
area_displayed = new QRect(QPoint(0, 0), curr_map->size());
}
void Speller::poseCB(nav_msgs::Odometry::ConstPtr &msg) {