Skip to content

Commit

Permalink
Remove unnecessary Fl_Widget_Tracker from Fl_Dial's handle().
Browse files Browse the repository at this point in the history
handle_push() doesn't call a callback, hence Fl_Widget_Tracker is not
necessary.

Added FALLTHROUGH and NOTREACHED comments.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12279 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
  • Loading branch information
Albrecht Schlosser committed Jun 29, 2017
1 parent 14a6e9d commit c6c4e8d
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/Fl_Dial.cxx
Expand Up @@ -103,10 +103,9 @@ void Fl_Dial::draw() {
*/
int Fl_Dial::handle(int event, int X, int Y, int W, int H) {
switch (event) {
case FL_PUSH: {
Fl_Widget_Tracker wp(this);
case FL_PUSH:
handle_push();
if (wp.deleted()) return 1; }
/* FALLTHROUGH */
case FL_DRAG: {
int mx = (Fl::event_x()-X-W/2)*H;
int my = (Fl::event_y()-Y-H/2)*W;
Expand All @@ -124,12 +123,13 @@ int Fl_Dial::handle(int event, int X, int Y, int W, int H) {
val = minimum() + (maximum()-minimum())*(angle-a1)/(a2-a1);
}
handle_drag(clamp(round(val)));
} return 1;
return 1;
} /* NOTREACHED */
case FL_RELEASE:
handle_release();
return 1;
case FL_ENTER : /* FALLTHROUGH */
case FL_LEAVE :
case FL_ENTER: /* FALLTHROUGH */
case FL_LEAVE:
return 1;
default:
return 0;
Expand Down Expand Up @@ -163,8 +163,7 @@ Fl_Fill_Dial::Fl_Fill_Dial(int X,int Y,int W,int H, const char *L)


Fl_Line_Dial::Fl_Line_Dial(int X,int Y,int W,int H, const char *L)
: Fl_Dial(X,Y,W,H,L)
{
: Fl_Dial(X,Y,W,H,L) {
type(FL_LINE_DIAL);
}

Expand Down

0 comments on commit c6c4e8d

Please sign in to comment.