From c213fb6ca2ed68722152df2d07ede6860846786b Mon Sep 17 00:00:00 2001 From: fluxgen Date: Tue, 6 Jul 2004 10:47:36 +0000 Subject: fixed minor bug --- src/FbTk/FbPixmap.cc | 16 ++++++++-------- src/FbTk/GContext.hh | 6 +++++- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/src/FbTk/FbPixmap.cc b/src/FbTk/FbPixmap.cc index cac6cf0..bbc1906 100644 --- a/src/FbTk/FbPixmap.cc +++ b/src/FbTk/FbPixmap.cc @@ -19,7 +19,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: FbPixmap.cc,v 1.11 2004/07/05 23:51:57 fluxgen Exp $ +// $Id: FbPixmap.cc,v 1.12 2004/07/06 10:47:36 fluxgen Exp $ #include "FbPixmap.hh" #include "App.hh" @@ -253,19 +253,19 @@ void FbPixmap::tile(unsigned int dest_width, unsigned int dest_height) { (dest_width == width() && dest_height == height())) return; - Display *dpy = FbTk::App::instance()->display(); - FbPixmap new_pm(drawable(), width(), height(), depth()); new_pm.copy(m_pm); - resize(dest_width,dest_height); + resize(dest_width, dest_height); - GC gc = XCreateGC(dpy, drawable(), 0, NULL); + FbTk::GContext gc(*this); + + gc.setTile(new_pm); + gc.setFillStyle(FillTiled); - XSetTile(dpy,gc,new_pm.release()); - XSetFillStyle(dpy, gc, FillTiled); - XFillRectangle(dpy,drawable(),gc, 0, 0, dest_width, dest_height); + fillRectangle(gc.gc(), 0, 0, dest_width, dest_height); + } diff --git a/src/FbTk/GContext.hh b/src/FbTk/GContext.hh index 57a467e..4327c97 100644 --- a/src/FbTk/GContext.hh +++ b/src/FbTk/GContext.hh @@ -19,7 +19,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: GContext.hh,v 1.9 2004/03/22 20:56:15 fluxgen Exp $ +// $Id: GContext.hh,v 1.10 2004/07/06 10:47:36 fluxgen Exp $ #ifndef FBTK_GCONTEXT_HH #define FBTK_GCONTEXT_HH @@ -66,6 +66,10 @@ public: XSetBackground(m_display, m_gc, pixel_value); } + inline void setTile(const FbTk::FbPixmap &draw) { + XSetTile(m_display, m_gc, draw.drawable()); + } + /// not implemented inline void setFont(const FbTk::Font &) {} -- cgit v0.11.2