src/colorSelectDialog.cpp

changeset 498
791c831c8020
parent 493
16766ac1bbd9
child 538
2f85d4d286e5
equal deleted inserted replaced
497:c51941e590b6 498:791c831c8020
165 // ============================================================================= 165 // =============================================================================
166 // ----------------------------------------------------------------------------- 166 // -----------------------------------------------------------------------------
167 void ColorSelector::mousePressEvent (QMouseEvent* event) 167 void ColorSelector::mousePressEvent (QMouseEvent* event)
168 { QPointF scenepos = ui->viewport->mapToScene (event->pos()); 168 { QPointF scenepos = ui->viewport->mapToScene (event->pos());
169 169
170 ulong x = ( (ulong) scenepos.x() - (g_squareSize / 2)) / g_squareSize; 170 int x = (scenepos.x() - (g_squareSize / 2)) / g_squareSize;
171 ulong y = ( (ulong) scenepos.y() - (g_squareSize / 2)) / g_squareSize; 171 int y = (scenepos.y() - (g_squareSize / 2)) / g_squareSize;
172 ulong idx = (y * g_numColumns) + x; 172 int idx = (y * g_numColumns) + x;
173 173
174 LDColor* col = ::getColor (idx); 174 LDColor* col = ::getColor (idx);
175 175
176 if (!col) 176 if (!col)
177 return; 177 return;

mercurial