PixelPaint: Fix broken "Color Masking" selection

This change solves a problem where the color selection via mouse click
on the color wheel was computing a wrong hue angle.
This commit is contained in:
Torstennator 2024-06-25 20:07:15 +02:00 committed by Nico Weber
parent bb0bfb7944
commit 490d61d694

View file

@ -437,8 +437,8 @@ double ColorWheelWidget::hue()
void ColorWheelWidget::calc_hue(Gfx::IntPoint const& position)
{
auto center = Gfx::IntPoint(width() / 2, height() / 2);
auto angle = AK::to_degrees(AK::atan2(static_cast<float>(position.y() - center.y()), static_cast<float>(position.x() - center.x())));
auto angle = AK::atan2(static_cast<float>(position.y() - center.y()), AK::to_degrees(static_cast<float>(position.x() - center.x())));
set_hue(angle + 90);
}