darkfi пре 10 месеци
родитељ
комит
9ff8a28a73
5 измењених фајлова са 232 додато и 172 уклоњено
  1. 222 156
      bin/app/Cargo.lock
  2. 2 6
      bin/app/Cargo.toml
  3. 4 4
      bin/app/src/app/schema/test.rs
  4. 2 2
      bin/app/src/text2/render.rs
  5. 2 4
      bin/app/src/ui/edit/mod.rs

Разлика између датотеке није приказан због своје велике величине
+ 222 - 156
bin/app/Cargo.lock


+ 2 - 6
bin/app/Cargo.toml

@@ -52,9 +52,8 @@ file-rotate = "0.7.6"
 parking_lot = { version = "0.12.4", features = ["nightly"] }
 regex = "1.11"
 parley = { git = "https://github.com/linebender/parley.git" }
-swash = { git = "https://github.com/valadaptive/swash", branch = "tight-bounds" }
-# Use same zeno specified by swash
-zeno = { git = "https://github.com/valadaptive/zeno", branch = "tight-bounds" }
+swash = "0.2.5"
+zeno = "0.3.3"
 peniko = "*"
 
 fluent = "0.17"
@@ -80,9 +79,6 @@ halo2_gadgets = { git="https://github.com/parazyd/halo2", branch="v031" }
 # This patch didn't work for me
 #dirs-sys = {git="https://github.com/sbechet/dirs-sys-rs.git"}
 
-# Once merged, we can remove this
-swash = { git = "https://github.com/valadaptive/swash", branch = "tight-bounds" }
-
 [target.'cfg(not(target_os = "android"))'.dependencies]
 dirs = "5.0.1"
 

+ 4 - 4
bin/app/src/app/schema/test.rs

@@ -385,8 +385,8 @@ pub async fn make(app: &App, window: SceneNodePtr, i18n_fish: &I18nBabelFish) {
     */
 
     // Text edit
-    let node = create_singleline_edit("editz");
-    //let node = create_multiline_edit("editz");
+    //let node = create_singleline_edit("editz");
+    let node = create_multiline_edit("editz");
     node.set_property_bool(atom, Role::App, "is_active", true).unwrap();
     node.set_property_bool(atom, Role::App, "is_focused", true).unwrap();
 
@@ -461,8 +461,8 @@ pub async fn make(app: &App, window: SceneNodePtr, i18n_fish: &I18nBabelFish) {
                 me,
                 window_scale.clone(),
                 app.render_api.clone(),
-                BaseEditType::SingleLine,
-                //BaseEditType::MultiLine,
+                //BaseEditType::SingleLine,
+                BaseEditType::MultiLine,
             )
         })
         .await;

+ 2 - 2
bin/app/src/text2/render.rs

@@ -105,7 +105,7 @@ fn render_glyph_run(
     }
 
     for glyph in glyph_run.glyphs() {
-        let glyph_inf = atlas.fetch_uv(glyph.id).expect("missing glyph UV rect");
+        let glyph_inf = atlas.fetch_uv(glyph.id as u16).expect("missing glyph UV rect");
 
         let glyph_x = run_x + glyph.x;
         let glyph_y = run_y - glyph.y;
@@ -188,7 +188,7 @@ fn create_atlas(
 
     let mut atlas = Atlas::new(scaler, render_api, tag);
     for glyph in glyph_run.glyphs() {
-        atlas.push_glyph(glyph.id);
+        atlas.push_glyph(glyph.id as u16);
     }
     //atlas.dump(&format!("/tmp/atlas_{run_idx}.png"));
     atlas.make()

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

@@ -417,7 +417,7 @@ impl BaseEdit {
         let rect = self.rect.get();
         *point -= rect.pos();
         *point -= self.behave.inner_pos();
-        point.y += self.scroll.get();
+        *point -= self.behave.scroll();
     }
 
     /// Gets the real cursor pos within the rect.
@@ -1051,13 +1051,11 @@ impl BaseEdit {
         //t!("regen_phone_select_handle_mesh()");
         let (first, last) = self.get_select_handles().await.unwrap();
 
-        let scroll = self.scroll.get();
-
         let editor = self.lock_editor().await;
         let sel = editor.selection();
         assert!(!sel.is_collapsed());
 
-        let pos = self.behave.inner_pos() + Point::new(0., -scroll);
+        let pos = self.behave.inner_pos() + self.behave.scroll();
 
         // We could cache this and use Move instead but why bother?
         let mut mesh = MeshBuilder::new(gfxtag!("chatedit_phone_select_handle"));

Неке датотеке нису приказане због велике количине промена