A simple CPU rendered GUI IDE experience.
bendn 9 days ago
parent 63b648c · commit 7235de8
-rw-r--r--src/main.rs3
-rw-r--r--src/text.rs2
-rw-r--r--src/text/cursor.rs1
3 files changed, 4 insertions, 2 deletions
diff --git a/src/main.rs b/src/main.rs
index 49466c6..7d2080e 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -67,6 +67,7 @@ use lsp_types::*;
use rust_fsm::StateMachine;
use serde::{Deserialize, Serialize};
use swash::FontRef;
+use winit::dpi::{LogicalSize, PhysicalSize};
use winit::event::{
ElementState, Event, Ime, MouseButton, MouseScrollDelta, WindowEvent,
};
@@ -263,6 +264,7 @@ pub(crate) fn entry(event_loop: EventLoop<()>) {
Some((.., c)) => c.take(),
None => None,
};
+ let (fw, fh) = dsb::dims(&fonts.bold, ls);
let app = winit_app::WinitAppBuilder::with_init(
move |elwt| {
@@ -270,6 +272,7 @@ pub(crate) fn entry(event_loop: EventLoop<()>) {
x.with_title("gracilaria")
.with_decorations(false)
.with_name("com.bendn.gracilaria", "")
+ .with_resize_increments(PhysicalSize::new(fw, fh))
.with_window_icon(Some(
Icon::from_rgba(
include_bytes!("../dist/icon-32").to_vec(),
diff --git a/src/text.rs b/src/text.rs
index 61cbe79..3796346 100644
--- a/src/text.rs
+++ b/src/text.rs
@@ -665,8 +665,6 @@ impl TextArea {
}
}
pub fn enter(&mut self) {
- use run::Run;
-
// let oc = self.cursor;
ceach!(self.cursor, |cursor| {
let n = cursor.indentation(&self.rope);
diff --git a/src/text/cursor.rs b/src/text/cursor.rs
index b98793b..37f6937 100644
--- a/src/text/cursor.rs
+++ b/src/text/cursor.rs
@@ -157,6 +157,7 @@ impl Cursor {
self.setc(r);
self.set_ho();
}
+ #[lower::apply(saturating)]
pub fn at_(self, r: &Rope) -> char {
r.get_char(*self - 1).unwrap_or('\n')
}