From 31f8c363beb1e3198964884b28b91139462d10aa Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Sun, 3 May 2015 17:47:41 +0100 Subject: [PATCH] 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. --- render/box_textarea.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/render/box_textarea.c b/render/box_textarea.c index aaee47170..1de6c9813 100644 --- a/render/box_textarea.c +++ b/render/box_textarea.c @@ -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;