Fixes to histogram and tone curve grids

This commit is contained in:
Maciek Dworak
2011-01-24 23:02:49 +00:00
parent f4d522ed9f
commit 0d0cbc8f24
2 changed files with 11 additions and 10 deletions

View File

@@ -387,10 +387,12 @@ void HistogramArea::renderHistogram () {
bgc->set_line_attributes (1, Gdk::LINE_ON_OFF_DASH, Gdk::CAP_NOT_LAST, Gdk::JOIN_MITER);
backBuffer->draw_line (bgc, winw/3, 0, winw/3, winh-1);
backBuffer->draw_line (bgc, 2*winw/3, 0, 2*winw/3, winh-1);
backBuffer->draw_line (bgc, 0, winh/3, winw-1, winh/3);
backBuffer->draw_line (bgc, 0, 2*winh/3, winw-1, 2*winh/3);
backBuffer->draw_line (bgc, winw/4, 0, winw/4, winh);
backBuffer->draw_line (bgc, 2*winw/4, 0, 2*winw/4, winh);
backBuffer->draw_line (bgc, 3*winw/4, 0, 3*winw/4, winh);
backBuffer->draw_line (bgc, 0, winh/4, winw, winh/4);
backBuffer->draw_line (bgc, 0, 2*winh/4, winw, 2*winh/4);
backBuffer->draw_line (bgc, 0, 3*winh/4, winw, 3*winh/4);
bgc->set_line_attributes (1, Gdk::LINE_SOLID, Gdk::CAP_NOT_LAST, Gdk::JOIN_MITER);

View File

@@ -182,11 +182,11 @@ void MyCurve::draw (int handle) {
c = style->get_dark (state);
cr->set_source_rgb (c.get_red_p(), c.get_green_p(), c.get_blue_p());
cr->set_antialias (Cairo::ANTIALIAS_NONE);
for (int i = 0; i < 5; i++) {
cr->move_to (RADIUS, MAX(0,i * innerHeight / 4 - 1) + RADIUS);
cr->line_to (innerWidth + RADIUS, MAX(0,i * innerHeight / 4 - 1) + RADIUS);
cr->move_to (MAX(0,i * innerWidth / 4 - 1) + RADIUS, RADIUS);
cr->line_to (MAX(0,i * innerWidth / 4 - 1) + RADIUS, innerHeight + RADIUS);
for (int i = 0; i < 5; i++) { // + 0.5 to align well with f(x)=x so it will cut through the center
cr->move_to (RADIUS, MAX(0,i * (innerHeight + 0.5) / 4) + RADIUS);
cr->line_to (innerWidth + RADIUS, MAX(0,i * (innerHeight + 0.5) / 4) + RADIUS);
cr->move_to (MAX(0,i * innerWidth / 4) + RADIUS, RADIUS);
cr->line_to (MAX(0,i * innerWidth / 4) + RADIUS, innerHeight + RADIUS);
}
cr->stroke ();
@@ -200,7 +200,6 @@ void MyCurve::draw (int handle) {
cr->stroke ();
cr->unset_dash ();
cr->set_antialias (Cairo::ANTIALIAS_SUBPIXEL);
cr->set_line_width (1.0);