Skip to content
Snippets Groups Projects
Commit 6318abf4 authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

prevent crash if no string to draw

parent 0433876f
Branches
Tags
No related merge requests found
...@@ -56,6 +56,7 @@ class drawContextFltkCairo::queueString { ...@@ -56,6 +56,7 @@ class drawContextFltkCairo::queueString {
void flush() void flush()
{ {
if(_elements.empty()) return;
cairo_surface_t *surface = cairo_image_surface_create(CAIRO_FORMAT_A8, _totalWidth, _maxHeight); cairo_surface_t *surface = cairo_image_surface_create(CAIRO_FORMAT_A8, _totalWidth, _maxHeight);
cairo_t *cr = cairo_create(surface); cairo_t *cr = cairo_create(surface);
int pos = 0; int pos = 0;
......
...@@ -45,7 +45,6 @@ class drawContextFltkStringTexture::queueString { ...@@ -45,7 +45,6 @@ class drawContextFltkStringTexture::queueString {
void flush() void flush()
{ {
if(_elements.empty()) return; if(_elements.empty()) return;
//1000 should be _totalWidth but it does not work //1000 should be _totalWidth but it does not work
int w = 1000, h = _maxHeight; int w = 1000, h = _maxHeight;
Fl_Offscreen offscreen = fl_create_offscreen(w, h); Fl_Offscreen offscreen = fl_create_offscreen(w, h);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment