remove assert if drag message contains an unknown type.

Instead of asserting if a message contains an unsupported drag type
the message is now logged and ignored.
This commit is contained in:
Vincent Sanders 2015-05-03 17:47:41 +01:00
parent a375e58bb8
commit 31f8c363be

View File

@ -130,25 +130,29 @@ static void box_textarea_callback(void *data, struct textarea_msg *msg)
.x1 = INT_MAX,
.y1 = INT_MAX
};
html_drag_type drag_type;
union html_drag_owner drag_owner;
drag_owner.textarea = box;
switch (msg->data.drag) {
case TEXTAREA_DRAG_SCROLLBAR:
drag_type = HTML_DRAG_TEXTAREA_SCROLLBAR;
html_set_drag_type(html,
HTML_DRAG_TEXTAREA_SCROLLBAR,
drag_owner,
&rect);
break;
case TEXTAREA_DRAG_SELECTION:
drag_type = HTML_DRAG_TEXTAREA_SELECTION;
html_set_drag_type(html,
HTML_DRAG_TEXTAREA_SELECTION,
drag_owner,
&rect);
break;
default:
LOG(("Drag type not handled."));
assert(0);
LOG(("Drag type %d not handled.",
msg->data.drag));
break;
}
html_set_drag_type(html, drag_type, drag_owner,
&rect);
}
break;