Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -630,9 +630,11 @@ public void checkMousePos(double mouseX, double mouseY) {
double rotation = cursorPos.x < 0 ? Math.PI - rot : Math.PI + rot;
this.mouseAngleRad = (float) (rotation % (Math.PI * 2));
for (WheelSection section : this.sections) {
if ((
section.angleStart > section.angleEnd && rotation >= section.angleStart || rotation >= section.angleStart && rotation <= section.angleEnd
) && section.selectable) {
// 跨越 0° 的扇区由圆周末尾与开头两段组成。
boolean containsRotation = section.angleStart > section.angleEnd
? rotation >= section.angleStart || rotation <= section.angleEnd
: rotation >= section.angleStart && rotation <= section.angleEnd;
if (containsRotation && section.selectable) {
this.currentAngle = section.angle;
this.setCurrentSectionIndex(this.sections.indexOf(section));
break;
Expand Down
Loading