feat: improve Paint app UI
This commit is contained in:
@@ -170,13 +170,16 @@ static bool handle_colorbar_click(int mx, int my, bool right_click) {
|
||||
|
||||
int preview_sz = COLOR_BAR_H - 8;
|
||||
int sw_x = 4 + preview_sz + 16;
|
||||
int sw_h = SWATCH_SIZE / 2;
|
||||
int rows_total_h = 2 * sw_h + 1;
|
||||
int swatch_top = cbar_y + (COLOR_BAR_H - rows_total_h) / 2;
|
||||
|
||||
for (int i = 0; i < PALETTE_COUNT; i++) {
|
||||
int row = i >= 14 ? 1 : 0;
|
||||
int col = i >= 14 ? i - 14 : i;
|
||||
int sx = sw_x + col * (SWATCH_SIZE + 2);
|
||||
int sy = cbar_y + 2 + row * (SWATCH_SIZE / 2 + 1);
|
||||
int sh = SWATCH_SIZE / 2;
|
||||
int sy = swatch_top + row * (sw_h + 1);
|
||||
int sh = sw_h;
|
||||
|
||||
if (mx >= sx && mx < sx + SWATCH_SIZE && my >= sy && my < sy + sh) {
|
||||
if (right_click)
|
||||
|
||||
Reference in New Issue
Block a user