diff --git a/examples/sprite_and_ui_clickable.rs b/examples/sprite_and_ui_clickable.rs
index 375c1eb0131b12bb1ab2d75a545d29be9ea866fd..0afb584c4e46d19013cf82c0fe977aeea85d1ed4 100644
--- a/examples/sprite_and_ui_clickable.rs
+++ b/examples/sprite_and_ui_clickable.rs
@@ -16,6 +16,7 @@ fn setup(mut commands: Commands) {
             )),
             max_lines: CosmicMaxLines(1),
             mode: CosmicMode::InfiniteLine,
+            text_position: CosmicTextPosition::Left { padding: 5 },
             ..default()
         })
         .id();
@@ -36,6 +37,8 @@ fn setup(mut commands: Commands) {
 
     // Sprite editor
     commands.spawn((CosmicEditBundle {
+        max_lines: CosmicMaxLines(1),
+        mode: CosmicMode::InfiniteLine,
         sprite_bundle: SpriteBundle {
             // Sets size of text box
             sprite: Sprite {
diff --git a/src/input.rs b/src/input.rs
index ab4af4ed9e26fb9cbad47ee75c9ececb17dec935..135703e4497aa9d0177dc798f167760b06595d51 100644
--- a/src/input.rs
+++ b/src/input.rs
@@ -153,7 +153,7 @@ pub(crate) fn input_mouse(
                 camera_transform,
             ) {
                 let (mut x, y) = point(node_cursor_pos);
-                x += x_offset.min as i32;
+                x += x_offset.left as i32;
                 if shift {
                     editor.action(&mut font_system.0, Action::Drag { x, y });
                 } else {
@@ -193,7 +193,7 @@ pub(crate) fn input_mouse(
                 camera_transform,
             ) {
                 let (mut x, y) = point(node_cursor_pos);
-                x += x_offset.min as i32;
+                x += x_offset.left as i32;
                 if active_editor.is_changed() && !shift {
                     editor.action(&mut font_system.0, Action::Click { x, y });
                 } else {
@@ -355,13 +355,28 @@ pub(crate) fn input_kb(
         if keys.just_pressed(KeyCode::Backspace) & !readonly {
             // fix for issue #8
             let select = editor.selection();
-            if select != Selection::None {
-                // TODO: fix zero-width selections if needed
-                //
-                // if editor.cursor().line == select.line && editor.cursor().index == select.index {
-                //     editor.set_selection(Selection::None);
-                // }
+            match select {
+                Selection::Line(cursor) => {
+                    if editor.cursor().line == cursor.line && editor.cursor().index == cursor.index
+                    {
+                        editor.set_selection(Selection::None);
+                    }
+                }
+                Selection::Normal(cursor) => {
+                    if editor.cursor().line == cursor.line && editor.cursor().index == cursor.index
+                    {
+                        editor.set_selection(Selection::None);
+                    }
+                }
+                Selection::Word(cursor) => {
+                    if editor.cursor().line == cursor.line && editor.cursor().index == cursor.index
+                    {
+                        editor.set_selection(Selection::None);
+                    }
+                }
+                Selection::None => {}
             }
+
             *is_deleting = true;
             #[cfg(target_arch = "wasm32")]
             editor.action(&mut font_system.0, Action::Backspace);
@@ -372,6 +387,7 @@ pub(crate) fn input_kb(
         }
         if keys.just_pressed(KeyCode::Delete) && !readonly {
             editor.action(&mut font_system.0, Action::Delete);
+            editor.with_buffer_mut(|b| b.set_redraw(true));
         }
         if keys.just_pressed(KeyCode::Escape) {
             editor.action(&mut font_system.0, Action::Escape);
diff --git a/src/layout.rs b/src/layout.rs
index b0cd386c290d62f7f1e5ee0d48d200b44b47c1b3..498dd76400190a7ff32978f4feae42a416a63e05 100644
--- a/src/layout.rs
+++ b/src/layout.rs
@@ -120,25 +120,26 @@ pub fn set_x_offset(
         &CosmicMode,
         &CosmicEditor,
         &CosmicWidgetSize,
-        &CosmicPadding,
+        &CosmicTextPosition,
     )>,
 ) {
-    for (mut x_offset, mode, editor, size, padding) in query.iter_mut() {
+    for (mut x_offset, mode, editor, size, position) in query.iter_mut() {
         if mode != &CosmicMode::InfiniteLine {
             return;
         }
 
         let mut cursor_x = 0.;
+        let cursor = editor.cursor();
 
         if let Some(line) = editor.with_buffer(|b| b.clone()).layout_runs().next() {
             for (idx, glyph) in line.glyphs.iter().enumerate() {
-                if editor.cursor().affinity == Affinity::Before {
-                    if idx <= editor.cursor().index {
+                if cursor.affinity == Affinity::Before {
+                    if idx <= cursor.index {
                         cursor_x += glyph.w;
                     } else {
                         break;
                     }
-                } else if idx < editor.cursor().index {
+                } else if idx < cursor.index {
                     cursor_x += glyph.w;
                 } else {
                     break;
@@ -146,19 +147,25 @@ pub fn set_x_offset(
             }
         }
 
-        if x_offset.min == 0. && x_offset.max == 0. {
-            x_offset.max = size.x;
+        let padding_x = match position {
+            CosmicTextPosition::Center => 5.,
+            CosmicTextPosition::TopLeft { padding } => *padding as f32,
+            CosmicTextPosition::Left { padding } => *padding as f32,
+        };
+
+        if x_offset.width == 0. {
+            x_offset.width = size.x - padding_x * 2.;
         }
 
-        if cursor_x > x_offset.max {
-            let diff = cursor_x - x_offset.max;
-            x_offset.min += diff;
-            x_offset.max = cursor_x;
+        let right = x_offset.width + x_offset.left;
+
+        if cursor_x > right {
+            let diff = cursor_x - right;
+            x_offset.left += diff;
         }
-        if cursor_x < x_offset.min {
-            let diff = x_offset.min - cursor_x;
-            x_offset.min = cursor_x;
-            x_offset.max -= diff;
+        if cursor_x < x_offset.left {
+            let diff = x_offset.left - cursor_x;
+            x_offset.left -= diff;
         }
     }
 }
diff --git a/src/lib.rs b/src/lib.rs
index 96b04a1d076bd5476940d9f6ff4dd0efe5fa4215..b14e0c3ccdce0ab8d9dbba7deeab214b7d979010 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -78,8 +78,8 @@ pub struct ReadOnly; // tag component
 
 #[derive(Component, Debug, Default)]
 pub struct XOffset {
-    pub min: f32,
-    pub max: f32,
+    pub left: f32,
+    pub width: f32,
 }
 
 #[derive(Component, Deref, DerefMut)]
diff --git a/src/render.rs b/src/render.rs
index e66e95d4032524ad99380765fca91bd4e25483ae..7d7ed6b587be1453fe7140c2b07a1f6bda94ccf8 100644
--- a/src/render.rs
+++ b/src/render.rs
@@ -4,8 +4,8 @@ use image::{imageops::FilterType, GenericImageView};
 
 use crate::{
     layout::{CosmicPadding, CosmicWidgetSize},
-    CosmicBackground, CosmicBuffer, CosmicEditor, CosmicFontSystem, CursorColor, DefaultAttrs,
-    FillColor, ReadOnly, SelectionColor, XOffset,
+    CosmicBackground, CosmicBuffer, CosmicEditor, CosmicFontSystem, CosmicTextPosition,
+    CursorColor, DefaultAttrs, FillColor, ReadOnly, SelectionColor, XOffset,
 };
 
 #[derive(Resource)]
@@ -77,6 +77,7 @@ pub(crate) fn render_texture(
         &CosmicPadding,
         &XOffset,
         Option<&ReadOnly>,
+        &CosmicTextPosition,
     )>,
     mut font_system: ResMut<CosmicFontSystem>,
     mut images: ResMut<Assets<Image>>,
@@ -95,6 +96,7 @@ pub(crate) fn render_texture(
         padding,
         x_offset,
         readonly_opt,
+        position,
     ) in query.iter_mut()
     {
         // Draw background
@@ -133,6 +135,11 @@ pub(crate) fn render_texture(
             .color_opt
             .unwrap_or(cosmic_text::Color::rgb(0, 0, 0));
 
+        let x_offset_divisor = match position {
+            CosmicTextPosition::Center => 2.,
+            _ => 1.,
+        };
+
         let draw_closure = |x, y, w, h, color| {
             for row in 0..h as i32 {
                 for col in 0..w as i32 {
@@ -140,8 +147,8 @@ pub(crate) fn render_texture(
                         &mut pixels,
                         size.0.x as i32,
                         size.0.y as i32,
-                        x + col + padding.0.x as i32 - x_offset.min as i32,
-                        y + row + padding.0.y as i32,
+                        x + col + padding.x as i32 - (x_offset.left / x_offset_divisor) as i32,
+                        y + row + padding.y as i32,
                         color,
                     );
                 }