~ubuntu-branches/ubuntu/saucy/sgt-puzzles/saucy

« back to all changes in this revision

Viewing changes to ps.c

  • Committer: Bazaar Package Importer
  • Author(s): Ben Hutchings
  • Date: 2008-04-13 17:39:38 UTC
  • mto: (1.1.6 upstream) (3.1.2 lenny)
  • mto: This revision was merged to the branch mainline in revision 9.
  • Revision ID: james.westby@ubuntu.com-20080413173938-nnrvlls98m6ky6eq
ImportĀ upstreamĀ versionĀ 7983

Show diffs side-by-side

added added

removed removed

Lines of Context:
35
35
    int hatch;
36
36
    float r, g, b;
37
37
 
38
 
    print_get_colour(ps->drawing, colour, &hatch, &r, &g, &b);
 
38
    print_get_colour(ps->drawing, colour, ps->colour, &hatch, &r, &g, &b);
39
39
 
40
 
    if (ps->colour) {
41
 
        ps_printf(ps, "%g %g %g setrgbcolor fill\n", r, g, b);
42
 
    } else if (hatch == HATCH_SOLID || hatch == HATCH_CLEAR) {
43
 
        ps_printf(ps, "%d setgray fill\n", hatch == HATCH_CLEAR);
 
40
    if (hatch < 0) {
 
41
        if (ps->colour)
 
42
            ps_printf(ps, "%g %g %g setrgbcolor fill\n", r, g, b);
 
43
        else
 
44
            ps_printf(ps, "%g setgray fill\n", r);
44
45
    } else {
45
46
        /* Clip to the region. */
46
47
        ps_printf(ps, "gsave clip\n");
77
78
    int hatch;
78
79
    float r, g, b;
79
80
 
80
 
    print_get_colour(ps->drawing, colour, &hatch, &r, &g, &b);
 
81
    print_get_colour(ps->drawing, colour, ps->colour, &hatch, &r, &g, &b);
81
82
 
82
 
    if (ps->colour) {
83
 
        if (r != g || r != b)
84
 
            ps_printf(ps, "%g %g %g setrgbcolor%s\n", r, g, b, suffix);
85
 
        else
86
 
            ps_printf(ps, "%g setgray%s\n", r, suffix);
87
 
    } else {
88
 
        /*
89
 
         * Stroking in hatched colours is not permitted.
90
 
         */
91
 
        assert(hatch == HATCH_SOLID || hatch == HATCH_CLEAR);
92
 
        ps_printf(ps, "%d setgray%s\n", hatch == HATCH_CLEAR, suffix);
93
 
    }
 
83
    /*
 
84
     * Stroking in hatched colours is not permitted.
 
85
     */
 
86
    assert(hatch < 0);
 
87
    
 
88
    if (ps->colour)
 
89
        ps_printf(ps, "%g %g %g setrgbcolor%s\n", r, g, b, suffix);
 
90
    else
 
91
        ps_printf(ps, "%g setgray%s\n", r, suffix);
94
92
}
95
93
 
96
94
static void ps_setcolour(psdata *ps, int colour)