src/colorSelectDialog.cpp

changeset 421
7d26db0be944
parent 410
a5aebcf4a1c8
child 455
c5d14d112034
equal deleted inserted replaced
420:8d6af951b611 421:7d26db0be944
160 } 160 }
161 161
162 m_firstResize = false; 162 m_firstResize = false;
163 } 163 }
164 164
165 (void) ev;
165 drawScene(); 166 drawScene();
166 } 167 }
167 168
168 // ============================================================================= 169 // =============================================================================
169 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 170 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
170 // ============================================================================= 171 // =============================================================================
171 void ColorSelector::mousePressEvent (QMouseEvent* event) { 172 void ColorSelector::mousePressEvent (QMouseEvent* event) {
172 QPointF scenepos = ui->viewport->mapToScene (event->pos()); 173 QPointF scenepos = ui->viewport->mapToScene (event->pos());
173 174
174 ulong x = ( (ulong) scenepos.x() - (g_squareSize / 2)) / g_squareSize; 175 ulong x = ((ulong) scenepos.x() - (g_squareSize / 2)) / g_squareSize;
175 ulong y = ( (ulong) scenepos.y() - (g_squareSize / 2)) / g_squareSize; 176 ulong y = ((ulong) scenepos.y() - (g_squareSize / 2)) / g_squareSize;
176 ulong idx = (y * g_numColumns) + x; 177 ulong idx = (y * g_numColumns) + x;
177 178
178 LDColor* col = ::getColor (idx); 179 LDColor* col = ::getColor (idx);
179 180
180 if (!col) 181 if (!col)

mercurial