| 96 | } |
| 97 | |
| 98 | void TilePickerTab::mousePressEvent(QMouseEvent* e) |
| 99 | { |
| 100 | int ox = e->x()-e->x()%TILE_X; |
| 101 | int oy = e->y()-e->y()%TILE_Y; |
| 102 | QImage subimage = image.copy(ox,oy,TILE_X,TILE_Y); |
| 103 | if ( e->button() == RightButton ) { |
| 104 | setCurrent(subimage); |
| 105 | } else { |
| 106 | last_pick = ox/TILE_X + oy/TILE_Y*TILES_ACROSS; |
| 107 | } |
| 108 | emit pick(subimage); |
| 109 | emit pickName(tilename(id, last_pick)); |
| 110 | } |
| 111 | |
| 112 | void TilePickerTab::setCurrent(const QImage& i) |
| 113 | { |
nothing calls this directly
no test coverage detected