From 653396fc51548aa0e2ebc9a151261cfc12958a55 Mon Sep 17 00:00:00 2001 From: Albrecht Schlosser Date: Tue, 17 Feb 2015 16:06:05 +0000 Subject: Restore window background image drawing (STR #3059). This was a regression since FLTK 1.3.0, because the window's label was not drawn anymore. However, the label drawing code is also responsible for drawing a background image. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10584 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl_Window_shape.cxx | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/Fl_Window_shape.cxx b/src/Fl_Window_shape.cxx index e428934db..9da04bfce 100644 --- a/src/Fl_Window_shape.cxx +++ b/src/Fl_Window_shape.cxx @@ -1,9 +1,9 @@ // // "$Id$" // -// implementation of Fl_Window::shape(Fl_Image*) for the Fast Light Tool Kit (FLTK). +// Implementation of Fl_Window::shape(Fl_Image*) for the Fast Light Tool Kit (FLTK). // -// Copyright 2010-2014 by Bill Spitzak and others. +// Copyright 2010-2015 by Bill Spitzak and others. // // This library is free software. Distribution and use rights are outlined in // the file "COPYING" which should have been included with this file. If this @@ -358,16 +358,18 @@ void Fl_Window::draw() { } # endif } - + // The following is similar to Fl_Group::draw(), but ... - // - we draw the box with x=0 and y=0 instead of x() and y() - // - we don't draw a label - + // - draws the box at (0,0), i.e. with x=0 and y=0 instead of x() and y() + // - draws the label at (0,0): this draws the background image, if any + // Note: align() *must* be set correctly for this to work as expected + if (damage() & ~FL_DAMAGE_CHILD) { // draw the entire thing draw_box(box(),0,0,w(),h(),color()); // draw box with x/y = 0 + draw_label(0,0,w(),h()); // draws label and/or bg image } draw_children(); - + #ifdef __APPLE_QUARTZ__ // on OS X, windows have no frame. Before OS X 10.7, to resize a window, we drag the lower right // corner. This code draws a little ribbed triangle for dragging. -- cgit v1.2.3