mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 05:00:20 +00:00
I'm trying to figure something out that prints reasonably..
I'll get there. Shrink it down a bit, start adding notes and location, and maybe put three per page. That might work. .. or maybe I should just take a look at how others have done this. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
a0096f3a6b
commit
b4c84c1a2e
1 changed files with 6 additions and 7 deletions
13
profile.c
13
profile.c
|
@ -43,10 +43,11 @@ static void line_to(struct graphics_context *gc, double x, double y)
|
||||||
static void set_source_rgba(struct graphics_context *gc, double r, double g, double b, double a)
|
static void set_source_rgba(struct graphics_context *gc, double r, double g, double b, double a)
|
||||||
{
|
{
|
||||||
if (gc->printer) {
|
if (gc->printer) {
|
||||||
a = 1;
|
/* Black is white and white is black */
|
||||||
if (r+g+b > 1)
|
double sum = r+g+b;
|
||||||
|
if (sum > 2)
|
||||||
r = g = b = 0;
|
r = g = b = 0;
|
||||||
else
|
else if (sum < 1)
|
||||||
r = g = b = 1;
|
r = g = b = 1;
|
||||||
}
|
}
|
||||||
cairo_set_source_rgba(gc->cr, r, g, b, a);
|
cairo_set_source_rgba(gc->cr, r, g, b, a);
|
||||||
|
@ -293,10 +294,8 @@ static void plot_depth_profile(struct dive *dive, struct graphics_context *gc, s
|
||||||
line_to(gc, MIN(sec,maxtime), 0);
|
line_to(gc, MIN(sec,maxtime), 0);
|
||||||
line_to(gc, begins, 0);
|
line_to(gc, begins, 0);
|
||||||
cairo_close_path(cr);
|
cairo_close_path(cr);
|
||||||
if (!gc->printer) {
|
set_source_rgba(gc, 1, 0.2, 0.2, 0.20);
|
||||||
set_source_rgba(gc, 1, 0.2, 0.2, 0.20);
|
cairo_fill_preserve(cr);
|
||||||
cairo_fill_preserve(cr);
|
|
||||||
}
|
|
||||||
set_source_rgba(gc, 1, 0.2, 0.2, 0.80);
|
set_source_rgba(gc, 1, 0.2, 0.2, 0.80);
|
||||||
cairo_stroke(cr);
|
cairo_stroke(cr);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue