MCPcopy Create free account
hub / github.com/NetHack/NetHack / mousePressEvent

Method mousePressEvent

outdated/win/Qt3/tileedit.cpp:98–110  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

96}
97
98void 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
112void TilePickerTab::setCurrent(const QImage& i)
113{

Callers

nothing calls this directly

Calls 1

tilenameFunction · 0.85

Tested by

no test coverage detected