mirror of
https://bitbucket.org/mfeemster/fractorium.git
synced 2025-01-21 21:20:07 -05:00
--Bug fixes
-Clicking random palette when using a palette file with only two entries in it could lead to a program freeze.
This commit is contained in:
parent
b315c1d35b
commit
3f83b49cf0
@ -274,9 +274,9 @@ void Fractorium::OnPaletteCellDoubleClicked(int row, int col)
|
|||||||
void Fractorium::OnPaletteRandomSelectButtonClicked(bool checked)
|
void Fractorium::OnPaletteRandomSelectButtonClicked(bool checked)
|
||||||
{
|
{
|
||||||
uint i = 0;
|
uint i = 0;
|
||||||
int rowCount = ui.PaletteListTable->rowCount() - 1;
|
int rowCount = ui.PaletteListTable->rowCount();
|
||||||
|
|
||||||
while ((i = QTIsaac<ISAAC_SIZE, ISAAC_INT>::LockedRand(rowCount)) == uint(m_PreviousPaletteRow));
|
while (((i = QTIsaac<ISAAC_SIZE, ISAAC_INT>::LockedRand(rowCount)) == uint(m_PreviousPaletteRow)) || i >= uint(rowCount));
|
||||||
|
|
||||||
if (checked)
|
if (checked)
|
||||||
OnPaletteCellDoubleClicked(i, 1);//Will clear the adjustments.
|
OnPaletteCellDoubleClicked(i, 1);//Will clear the adjustments.
|
||||||
|
@ -567,8 +567,8 @@ map<float, GradientArrow> PaletteEditor::GetRandomColorsFromImage(QString filena
|
|||||||
|
|
||||||
for (int i = 0; i < numPoints; i++)
|
for (int i = 0; i < numPoints; i++)
|
||||||
{
|
{
|
||||||
int x = QTIsaac<ISAAC_SIZE, ISAAC_INT>::LockedRand() % image.width();
|
int x = QTIsaac<ISAAC_SIZE, ISAAC_INT>::LockedRand(image.width());
|
||||||
int y = QTIsaac<ISAAC_SIZE, ISAAC_INT>::LockedRand() % image.height();
|
int y = QTIsaac<ISAAC_SIZE, ISAAC_INT>::LockedRand(image.height());
|
||||||
QRgb rgb = image.pixel(x, y);
|
QRgb rgb = image.pixel(x, y);
|
||||||
GradientArrow arrow;
|
GradientArrow arrow;
|
||||||
arrow.Color(QColor::fromRgb(rgb));
|
arrow.Color(QColor::fromRgb(rgb));
|
||||||
|
Loading…
Reference in New Issue
Block a user