~ubuntu-branches/ubuntu/raring/libcaca/raring

« back to all changes in this revision

Viewing changes to cucul/cucul.c

  • Committer: Bazaar Package Importer
  • Author(s): Sam Hocevar (Debian packages)
  • Date: 2007-10-13 20:10:44 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20071013201044-35yldy9w3xe7iy2j
Tags: 0.99.beta12.debian-3
* debian/control:
  + Build-depend on texlive instead of all the other texlive-* packages so
    that we have the proper fonts at build time (Closes: #445797).

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
 *  Copyright (c) 2002-2006 Sam Hocevar <sam@zoy.org>
4
4
 *                All Rights Reserved
5
5
 *
6
 
 *  $Id: cucul.c 1063 2006-11-13 23:16:35Z sam $
 
6
 *  $Id: cucul.c 1143 2007-08-02 17:33:10Z sam $
7
7
 *
8
 
 *  This library is free software; you can redistribute it and/or
9
 
 *  modify it under the terms of the Do What The Fuck You Want To
10
 
 *  Public License, Version 2, as published by Sam Hocevar. See
 
8
 *  This library is free software. It comes without any warranty, to
 
9
 *  the extent permitted by applicable law. You can redistribute it
 
10
 *  and/or modify it under the terms of the Do What The Fuck You Want
 
11
 *  To Public License, Version 2, as published by Sam Hocevar. See
11
12
 *  http://sam.zoy.org/wtfpl/COPYING for more details.
12
13
 */
13
14
 
105
106
 *  canvas size. Newly allocated character cells at the right and/or at
106
107
 *  the bottom of the canvas are filled with spaces.
107
108
 *
 
109
 *  If as a result of the resize the cursor coordinates fall outside the
 
110
 *  new canvas boundaries, they are readjusted. For instance, if the
 
111
 *  current X cursor coordinate is 11 and the requested width is 10, the
 
112
 *  new X cursor coordinate will be 10.
 
113
 *
108
114
 *  It is an error to try to resize the canvas if an output driver has
109
115
 *  been attached to the canvas using caca_create_display(). You need to
110
116
 *  remove the output driver using caca_free_display() before you can change
111
 
 *  the  canvas size again. However, the caca output driver can cause a
 
117
 *  the canvas size again. However, the caca output driver can cause a
112
118
 *  canvas resize through user interaction. See the caca_event() documentation
113
119
 *  for more about this.
114
120
 *
352
358
    /* Set new size */
353
359
    for(f = 0; f < cv->framecount; f++)
354
360
    {
 
361
        if(cv->frames[f].x > (int)width)
 
362
            cv->frames[f].x = width;
 
363
        if(cv->frames[f].y > (int)height)
 
364
            cv->frames[f].y = height;
 
365
 
355
366
        cv->frames[f].width = width;
356
367
        cv->frames[f].height = height;
357
368
    }