minor fix

This commit is contained in:
Piyush मिश्रः 2021-01-15 20:19:35 +05:30
parent 1652209386
commit a3960851dc
2 changed files with 7 additions and 3 deletions

View File

@ -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);

View File

@ -104,7 +104,7 @@ pub fn build_ui(app: &gtk::Application, config: Arc::<Mutex::<Config>>) {
let stambh_1 = builder.get_object::<gtk::Entry>("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::<f64>().unwrap_or(0.0);
let purana_y_start = tmp_graph.scale_y_start;
@ -118,7 +118,7 @@ pub fn build_ui(app: &gtk::Application, config: Arc::<Mutex::<Config>>) {
let stambh_2 = builder.get_object::<gtk::Entry>("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::<f64>().unwrap_or(0.0);
let y_start = tmp_graph.scale_y_start;
@ -134,6 +134,10 @@ pub fn build_ui(app: &gtk::Application, config: Arc::<Mutex::<Config>>) {
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