diff --git a/src/graph.rs b/src/graph.rs index 76d80a2..f276320 100644 --- a/src/graph.rs +++ b/src/graph.rs @@ -217,7 +217,7 @@ impl Graph { for i in (0..aa_dumm_stambh as i32 + 1).rev() { let text = math::round::floor(i as f64 * anupat_stambh + graph.scale_y_start, 4).to_string(); let f = ctx.text_extents(&text); - ctx.move_to(stambh_scale_width - f.width + f.height / 1.732, height - i as f64 * manjusa_maap + f.width * 0.5); + ctx.move_to(stambh_scale_width - f.width, height - i as f64 * manjusa_maap + f.width * 0.5); ctx.save(); ctx.rotate(std::f64::consts::PI / -6.0); ctx.show_text(&text); diff --git a/src/lib.rs b/src/lib.rs index 78cb5d5..59bd598 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -104,7 +104,7 @@ pub fn build_ui(app: >k::Application, config: Arc::>) { let stambh_1 = builder.get_object::("stambh_1").expect("Resource file missing!"); let tmp_graph = Rc::clone(&graph); - stambh_1.connect_changed(move |entry| { + stambh_1.connect_activate(move |entry| { let mut tmp_graph = tmp_graph.borrow_mut(); let val = entry.get_text().parse::().unwrap_or(0.0); let purana_y_start = tmp_graph.scale_y_start; @@ -118,7 +118,7 @@ pub fn build_ui(app: >k::Application, config: Arc::>) { let stambh_2 = builder.get_object::("stambh_2").expect("Resource file missing!"); let tmp_graph = Rc::clone(&graph); - stambh_2.connect_changed(move |entry| { + stambh_2.connect_activate(move |entry| { let mut tmp_graph = tmp_graph.borrow_mut(); let val = entry.get_text().parse::().unwrap_or(0.0); let y_start = tmp_graph.scale_y_start; @@ -134,6 +134,10 @@ pub fn build_ui(app: >k::Application, config: Arc::>) { tmp_graph.borrow_mut().auto_adjust_y = !btn.get_active(); stambh_1.set_sensitive(btn.get_active()); stambh_2.set_sensitive(btn.get_active()); + if btn.get_active() { + stambh_1.emit_activate(); + stambh_2.emit_activate(); + } }); // draw_patches