mirror of
https://github.com/fltk/fltk.git
synced 2026-05-27 10:57:58 +08:00
Fix simple SVG example (howto-simple-svg)
This commit is contained in:
@@ -14,7 +14,7 @@
|
|||||||
//
|
//
|
||||||
// https://www.fltk.org/bugs.php
|
// https://www.fltk.org/bugs.php
|
||||||
//
|
//
|
||||||
#include <config.h> /* needed only to detect FLTK_USE_NANOSVG */
|
#include <config.h> /* needed only to detect FLTK_USE_SVG */
|
||||||
#include <FL/Fl.H>
|
#include <FL/Fl.H>
|
||||||
#include <FL/Fl_Window.H>
|
#include <FL/Fl_Window.H>
|
||||||
#include <FL/Fl_Box.H>
|
#include <FL/Fl_Box.H>
|
||||||
@@ -53,12 +53,14 @@ const char *svg_logo =
|
|||||||
"</svg>\n";
|
"</svg>\n";
|
||||||
|
|
||||||
int main(int argc, char **argv) {
|
int main(int argc, char **argv) {
|
||||||
#ifndef FLTK_USE_NANOSVG
|
#ifndef FLTK_USE_SVG
|
||||||
fl_message("You need to build fltk with --enable-nanosvg to use this example.");
|
fl_message("You need to build FLTK with 'configure --enable-svg'\n"
|
||||||
|
"or CMake option 'OPTION_USE_SVG'\n"
|
||||||
|
"to use this example.");
|
||||||
return(1);
|
return(1);
|
||||||
#else
|
#else
|
||||||
Fl_SVG_Image *svg = new Fl_SVG_Image(NULL, svg_logo);
|
Fl_SVG_Image *svg = new Fl_SVG_Image(NULL, svg_logo);
|
||||||
Fl_Window *win = new Fl_Window(720, 486, "svg test");
|
Fl_Window *win = new Fl_Window(720, 486, "howto-simple-svg");
|
||||||
Fl_Box *box = new Fl_Box(10,10,720-20,486-20);
|
Fl_Box *box = new Fl_Box(10,10,720-20,486-20);
|
||||||
box->image(svg);
|
box->image(svg);
|
||||||
win->end();
|
win->end();
|
||||||
|
|||||||
Reference in New Issue
Block a user