//------------------------------------------------------------------------ gamma_ctrl_impl::gamma_ctrl_impl(double x1, double y1, double x2, double y2, bool flip_y) : ctrl(x1, y1, x2, y2, flip_y), m_border_width(2.0), m_border_extra(0.0), m_curve_width(2.0), m_grid_width(0.2), m_text_thickness(1.5), m_point_size(5.0), m_text_height(9.0), m_text_width(0.0), m_xc1(x1), m_yc1(y1), m_xc2(x2), m_yc2(y2 - m_text_height * 2.0), m_xt1(x1), m_yt1(y2 - m_text_height * 2.0), m_xt2(x2), m_yt2(y2), m_curve_poly(m_gamma_spline), m_text_poly(m_text), m_idx(0), m_vertex(0), m_p1_active(true), m_mouse_point(0), m_pdx(0.0), m_pdy(0.0) { calc_spline_box(); }
//------------------------------------------------------------------------ spline_ctrl_impl::spline_ctrl_impl(double x1, double y1, double x2, double y2, unsigned num_pnt, bool flip_y) : ctrl(x1, y1, x2, y2, flip_y), m_num_pnt(num_pnt), m_border_width(1.0), m_border_extra(0.0), m_curve_width(1.0), m_point_size(3.0), m_curve_poly(m_curve_pnt), m_idx(0), m_vertex(0), m_active_pnt(-1), m_move_pnt(-1), m_pdx(0.0), m_pdy(0.0) { if(m_num_pnt < 4) m_num_pnt = 4; if(m_num_pnt > 32) m_num_pnt = 32; unsigned i; for(i = 0; i < m_num_pnt; i++) { m_xp[i] = double(i) / double(m_num_pnt - 1); m_yp[i] = 0.5; } calc_spline_box(); update_spline(); }
//------------------------------------------------------------------------ void gamma_ctrl_impl::text_size(double h, double w) { m_text_width = w; m_text_height = h; m_yc2 = m_y2 - m_text_height * 2.0; m_yt1 = m_y2 - m_text_height * 2.0; calc_spline_box(); }
//------------------------------------------------------------------------ void spline_ctrl_impl::border_width(double t, double extra) { m_border_width = t; m_border_extra = extra; calc_spline_box(); }