Compare commits
2 commits
3036a8c97d
...
9fb86c4cf8
Author | SHA1 | Date | |
---|---|---|---|
9fb86c4cf8 | |||
f0ea268ab2 |
2 changed files with 9 additions and 7 deletions
2
LICENSE
2
LICENSE
|
@ -1,6 +1,6 @@
|
||||||
MIT License
|
MIT License
|
||||||
|
|
||||||
Copyright (c) 2020-2021,2023 Stephen Seo
|
Copyright (c) 2020-2021,2023-2024 Stephen Seo
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
|
|
@ -223,15 +223,17 @@ void Tri::State::handle_events() {
|
||||||
int mx = GetMouseX();
|
int mx = GetMouseX();
|
||||||
int my = GetMouseY();
|
int my = GetMouseY();
|
||||||
if(mx < 0) { mx = 0; }
|
if(mx < 0) { mx = 0; }
|
||||||
else if(mx >= (int)width) { mx = width - 1; }
|
else if(mx >= drawImage.width) { mx = drawImage.width - 1; }
|
||||||
if(my < 0) { my = 0; }
|
if(my < 0) { my = 0; }
|
||||||
else if(my >= (int)height) { my = height - 1; }
|
else if(my >= drawImage.height) { my = drawImage.height - 1; }
|
||||||
|
|
||||||
colorPickerColor[0] = colors[mx + my * width].r;
|
my = drawImage.height - my;
|
||||||
colorPickerColor[1] = colors[mx + my * width].g;
|
|
||||||
colorPickerColor[2] = colors[mx + my * width].b;
|
colorPickerColor[0] = (float)(colors[mx + my * drawImage.width].r) / 255.0F;
|
||||||
|
colorPickerColor[1] = (float)(colors[mx + my * drawImage.width].g) / 255.0F;
|
||||||
|
colorPickerColor[2] = (float)(colors[mx + my * drawImage.width].b) / 255.0F;
|
||||||
colorPickerColor[3] = 1.0f;
|
colorPickerColor[3] = 1.0f;
|
||||||
pointCircle.fillColor = colors[mx + my * width];
|
pointCircle.fillColor = colors[mx + my * drawImage.width];
|
||||||
flags.reset(F_COPY_COLOR_MODE);
|
flags.reset(F_COPY_COLOR_MODE);
|
||||||
set_notification_text("Color set");
|
set_notification_text("Color set");
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue