Changeset 354 for libcaca/trunk/src


Ignore:
Timestamp:
Jan 18, 2004, 5:17:35 AM (19 years ago)
Author:
Sam Hocevar
Message:
  • src/graphics.c: + When resizing under X11, copy the old pixmap to the new one.
  • examples/cacaview.c: + Resizing support.
Location:
libcaca/trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/src/event.c

    r353 r354  
    274274                unsigned int w, h;
    275275
     276                w = (xevent.xconfigure.width + x11_font_width / 3)
     277                      / x11_font_width;
    276278                h = (xevent.xconfigure.height + x11_font_height / 3)
    277279                      / x11_font_height;
    278                 w = (xevent.xconfigure.width + x11_font_width / 3)
    279                       / x11_font_width;
    280280
    281281                if(w == _caca_width && h == _caca_height)
  • libcaca/trunk/src/graphics.c

    r353 r354  
    13211321    if(_caca_driver == CACA_DRIVER_X11)
    13221322    {
     1323        Pixmap new_pixmap;
     1324
    13231325        _caca_width = x11_new_width;
    13241326        _caca_height = x11_new_height;
    13251327
    1326         XFreePixmap(x11_dpy, x11_pixmap);
    13271328        free(x11_char);
    13281329        free(x11_attr);
    13291330
    1330         x11_pixmap = XCreatePixmap(x11_dpy, x11_window,
     1331        new_pixmap = XCreatePixmap(x11_dpy, x11_window,
    13311332                                   _caca_width * x11_font_width,
    13321333                                   _caca_height * x11_font_height,
    13331334                                   DefaultDepth(x11_dpy,
    13341335                                                DefaultScreen(x11_dpy)));
     1336        XCopyArea(x11_dpy, x11_pixmap, new_pixmap, x11_gc, 0, 0,
     1337                  old_width * x11_font_width, old_height * x11_font_height,
     1338                  0, 0);
     1339        XFreePixmap(x11_dpy, x11_pixmap);
     1340        x11_pixmap = new_pixmap;
     1341
    13351342        x11_char = malloc(_caca_width * _caca_height * sizeof(int));
    13361343        memset(x11_char, 0, _caca_width * _caca_height * sizeof(int));
Note: See TracChangeset for help on using the changeset viewer.