mirror of
				https://bitbucket.org/mfeemster/fractorium.git
				synced 2025-10-31 09:20:23 -04: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:
		| @ -274,9 +274,9 @@ void Fractorium::OnPaletteCellDoubleClicked(int row, int col) | ||||
| void Fractorium::OnPaletteRandomSelectButtonClicked(bool checked) | ||||
| { | ||||
| 	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) | ||||
| 		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++) | ||||
| 	{ | ||||
| 		int x = QTIsaac<ISAAC_SIZE, ISAAC_INT>::LockedRand() % image.width(); | ||||
| 		int y = QTIsaac<ISAAC_SIZE, ISAAC_INT>::LockedRand() % image.height(); | ||||
| 		int x = QTIsaac<ISAAC_SIZE, ISAAC_INT>::LockedRand(image.width()); | ||||
| 		int y = QTIsaac<ISAAC_SIZE, ISAAC_INT>::LockedRand(image.height()); | ||||
| 		QRgb rgb = image.pixel(x, y); | ||||
| 		GradientArrow arrow; | ||||
| 		arrow.Color(QColor::fromRgb(rgb)); | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 Person
					Person