X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=profile.c;h=ad158fe8a1f9aaafb40b792f31dea13667594f5f;hb=edbba678b3cdc8f06a84a965b04f13ef1f4ecaab;hp=7caa5da9f98eb40071bbc390bef39ab93fc9eaac;hpb=d906c82f31c5406b6debe0df88cb49b916cd6ced;p=ext%2Fsubsurface.git diff --git a/profile.c b/profile.c index 7caa5da..ad158fe 100644 --- a/profile.c +++ b/profile.c @@ -276,6 +276,7 @@ static void plot_text_samples(struct graphics_context *gc, struct plot_info *pi) static const text_render_options_t deep = {14, 1.0, 0.2, 0.2, CENTER, TOP}; static const text_render_options_t shallow = {14, 1.0, 0.2, 0.2, CENTER, BOTTOM}; int i; + int last = -1; for (i = 0; i < pi->nr; i++) { struct plot_data *entry = pi->entry + i; @@ -283,11 +284,18 @@ static void plot_text_samples(struct graphics_context *gc, struct plot_info *pi) if (entry->depth < 2000) continue; - if (entry == entry->max[2]) + if ((entry == entry->max[2]) && entry->depth != last) { render_depth_sample(gc, entry, &deep); + last = entry->depth; + } - if (entry == entry->min[2]) + if ((entry == entry->min[2]) && entry->depth != last) { render_depth_sample(gc, entry, &shallow); + last = entry->depth; + } + + if (entry->depth != last) + last = -1; } }