Просмотр исходного кода

app: fix broken android build due to fixing warnings in 6919ef8782e4677ed86b22e60d621038e803a625

darkfi 9 месяцев назад
Родитель
Сommit
677a2a2b08
2 измененных файлов с 9 добавлено и 3 удалено
  1. 5 1
      bin/app/src/gfx/mod.rs
  2. 4 2
      bin/app/src/ui/edit/mod.rs

+ 5 - 1
bin/app/src/gfx/mod.rs

@@ -53,7 +53,7 @@ use trax::get_trax;
 use crate::{
     error::{Error, Result},
     prop::{BatchGuardId, PropertyAtomicGuard},
-    GOD,
+    ExecutorPtr, GOD,
 };
 
 // This is very noisy so suppress output by default
@@ -925,6 +925,8 @@ struct Stage {
     pruner: PruneMethodHeap,
     screen_was_off: bool,
     #[cfg(target_os = "android")]
+    ex: ExecutorPtr,
+    #[cfg(target_os = "android")]
     refresh_task: Option<smol::Task<()>>,
 }
 
@@ -1027,6 +1029,8 @@ impl Stage {
             pruner: PruneMethodHeap::new(epoch),
             screen_was_off: false,
             #[cfg(target_os = "android")]
+            ex,
+            #[cfg(target_os = "android")]
             refresh_task: None,
         }
     }

+ 4 - 2
bin/app/src/ui/edit/mod.rs

@@ -973,7 +973,7 @@ impl BaseEdit {
                 return
             }
             #[cfg(target_os = "android")]
-            assert!(start <= end);
+            assert!(start < end);
 
             //t!("handle_select(): set_selection({start}, {end})");
             editor.set_selection(start, end);
@@ -982,10 +982,12 @@ impl BaseEdit {
             editor.selected_text()
         };
         //d!("Select {seltext:?} from {clip_mouse_pos:?} (unclipped: {mouse_pos:?}) to ({sel_start}, {sel_end})");
+
         // Android editor impl detail: selection disappears when anchor == index
+        // But we disallow this so it should never happen. Just making a note of it here.
+        // See the android only assert that `start < end` in the block above.
         #[cfg(target_os = "android")]
         {
-            assert!(sel_start != sel_end);
             //if sel_start == sel_end {
             //    self.finish_select(atom);
             //}