mirror of
https://gitlab.com/yikestone/qt_pi.git
synced 2025-08-03 05:34:13 +05:30
corrected zoom in
This commit is contained in:
parent
e4629f0e6f
commit
5f0a934526
Binary file not shown.
@ -4,6 +4,5 @@
|
|||||||
<file>shaders/blink.vert</file>
|
<file>shaders/blink.vert</file>
|
||||||
<file>shaders/map.vert</file>
|
<file>shaders/map.vert</file>
|
||||||
<file>shaders/map.frag</file>
|
<file>shaders/map.frag</file>
|
||||||
<file>playground.pgm</file>
|
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
@ -66,24 +66,27 @@ void Speller::classify(int len, struct insight_data *buf) {
|
|||||||
void Speller::reconfigure_map(int result, int shape) {
|
void Speller::reconfigure_map(int result, int shape) {
|
||||||
int w = area_displayed->width();
|
int w = area_displayed->width();
|
||||||
int h = area_displayed->height();
|
int h = area_displayed->height();
|
||||||
|
int x = area_displayed->x();
|
||||||
|
int y = area_displayed->y();
|
||||||
|
|
||||||
switch (shape) {
|
switch (shape) {
|
||||||
case SQUARE:
|
case SQUARE:
|
||||||
switch (result) {
|
switch (result) {
|
||||||
case TOP_LEFT:
|
case TOP_LEFT:
|
||||||
area_displayed->setWidth(w / 1.9);
|
area_displayed->setWidth(w / 1.8);
|
||||||
area_displayed->setY(h * 0.9 / 1.9);
|
area_displayed->setY(y + h / 1.8);
|
||||||
break;
|
break;
|
||||||
case TOP_RIGHT:
|
case TOP_RIGHT:
|
||||||
area_displayed->setX(w * 0.9 / 1.9);
|
area_displayed->setX(x + w / 1.8);
|
||||||
area_displayed->setY(h * 0.9 / 1.9);
|
area_displayed->setY(y + h / 1.8);
|
||||||
break;
|
break;
|
||||||
case BOTTOM_LEFT:
|
case BOTTOM_LEFT:
|
||||||
area_displayed->setHeight(h / 1.9);
|
area_displayed->setHeight(h / 1.8);
|
||||||
area_displayed->setWidth(w / 1.9);
|
area_displayed->setWidth(w / 1.8);
|
||||||
break;
|
break;
|
||||||
case BOTTOM_RIGHT:
|
case BOTTOM_RIGHT:
|
||||||
area_displayed->setHeight(h / 1.9);
|
area_displayed->setHeight(h / 1.8);
|
||||||
area_displayed->setX(w * 0.9 / 1.9);
|
area_displayed->setX(x + w / 1.8);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -91,11 +94,11 @@ void Speller::reconfigure_map(int result, int shape) {
|
|||||||
switch (result) {
|
switch (result) {
|
||||||
case TOP_LEFT:
|
case TOP_LEFT:
|
||||||
case BOTTOM_LEFT:
|
case BOTTOM_LEFT:
|
||||||
area_displayed->setWidth(w / 1.9);
|
area_displayed->setWidth(w / 1.8);
|
||||||
break;
|
break;
|
||||||
case TOP_RIGHT:
|
case TOP_RIGHT:
|
||||||
case BOTTOM_RIGHT:
|
case BOTTOM_RIGHT:
|
||||||
area_displayed->setX(w * 0.9 / 1.9);
|
area_displayed->setX(x + w / 1.8);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -103,11 +106,11 @@ void Speller::reconfigure_map(int result, int shape) {
|
|||||||
switch (result) {
|
switch (result) {
|
||||||
case TOP_LEFT:
|
case TOP_LEFT:
|
||||||
case TOP_RIGHT:
|
case TOP_RIGHT:
|
||||||
area_displayed->setY(h * 0.9 / 1.9);
|
area_displayed->setY(h + h / 1.8);
|
||||||
break;
|
break;
|
||||||
case BOTTOM_LEFT:
|
case BOTTOM_LEFT:
|
||||||
case BOTTOM_RIGHT:
|
case BOTTOM_RIGHT:
|
||||||
area_displayed->setHeight(h / 1.9);
|
area_displayed->setHeight(h / 1.8);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -190,8 +193,7 @@ __inline__ void Speller::init_ros() {
|
|||||||
}
|
}
|
||||||
curr_map = new QImage(map_tex_buffer, map.info.width, map.info.height,
|
curr_map = new QImage(map_tex_buffer, map.info.width, map.info.height,
|
||||||
3 * map.info.width, QImage::Format_RGB888);
|
3 * map.info.width, QImage::Format_RGB888);
|
||||||
area_displayed = new QRect(QPoint(0, 0), QSize(curr_map->size().height() / 2,
|
area_displayed = new QRect(QPoint(0, 0), curr_map->size());
|
||||||
curr_map->size().width()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Speller::poseCB(nav_msgs::Odometry::ConstPtr &msg) {
|
void Speller::poseCB(nav_msgs::Odometry::ConstPtr &msg) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user