Add horizontal offset to Primitive::Clip

This commit is contained in:
Héctor Ramón Jiménez 2019-11-05 03:16:46 +01:00
parent ba470a2b2a
commit 470266f540
6 changed files with 40 additions and 25 deletions

View file

@ -1,7 +1,7 @@
use crate::{Primitive, Renderer};
use iced_native::{
scrollable, Background, Color, Layout, MouseCursor, Point, Rectangle,
Scrollable, Widget,
Scrollable, Vector, Widget,
};
const SCROLLBAR_WIDTH: u16 = 10;
@ -58,7 +58,7 @@ impl scrollable::Renderer for Renderer {
let clip = Primitive::Clip {
bounds,
offset,
offset: Vector::new(0, offset),
content: Box::new(content),
};

View file

@ -2,7 +2,7 @@ use crate::{Primitive, Renderer};
use iced_native::{
text::HorizontalAlignment, text::VerticalAlignment, text_input, Background,
Color, MouseCursor, Point, Rectangle, TextInput,
Color, MouseCursor, Point, Rectangle, TextInput, Vector,
};
use std::f32;
@ -89,7 +89,7 @@ impl text_input::Renderer for Renderer {
let content = Primitive::Clip {
bounds: text_bounds,
offset: 0,
offset: Vector::new(0, 0),
content: Box::new(if text_input.state.is_focused {
use wgpu_glyph::{GlyphCruncher, Scale, Section};