mirror of
https://github.com/FliegendeWurst/cursive.git
synced 2024-11-23 17:35:00 +00:00
Remove debug lines
This commit is contained in:
parent
3a836aaa92
commit
e7da474769
@ -1,7 +1,6 @@
|
|||||||
use num::Num;
|
use num::Num;
|
||||||
|
|
||||||
/// Integer division that rounds up.
|
/// Integer division that rounds up.
|
||||||
#[allow(dead_code)]
|
|
||||||
pub fn div_up<T>(p: T, q: T) -> T
|
pub fn div_up<T>(p: T, q: T) -> T
|
||||||
where
|
where
|
||||||
T: Num + Clone,
|
T: Num + Clone,
|
||||||
|
@ -147,7 +147,7 @@ impl ScrollBase {
|
|||||||
pub fn scroll_to_thumb(&mut self, thumb_y: usize, thumb_height: usize) {
|
pub fn scroll_to_thumb(&mut self, thumb_y: usize, thumb_height: usize) {
|
||||||
// The min() is there to stop at the bottom of the content.
|
// The min() is there to stop at the bottom of the content.
|
||||||
// The saturating_sub is there to stop at the bottom of the content.
|
// The saturating_sub is there to stop at the bottom of the content.
|
||||||
eprintln!("Scrolling to {}", thumb_y);
|
// eprintln!("Scrolling to {}", thumb_y);
|
||||||
self.start_line = min(
|
self.start_line = min(
|
||||||
div_up((1 + self.content_height - self.view_height) * thumb_y
|
div_up((1 + self.content_height - self.view_height) * thumb_y
|
||||||
, (self.view_height - thumb_height + 1)),
|
, (self.view_height - thumb_height + 1)),
|
||||||
@ -192,7 +192,7 @@ impl ScrollBase {
|
|||||||
pub fn drag(&mut self, position: Vec2) {
|
pub fn drag(&mut self, position: Vec2) {
|
||||||
// Our goal is self.scrollbar_thumb_y()+thumb_grab == position.y
|
// Our goal is self.scrollbar_thumb_y()+thumb_grab == position.y
|
||||||
// Which means that position.y is the middle of the scrollbar.
|
// Which means that position.y is the middle of the scrollbar.
|
||||||
eprintln!("Dragged: {:?}", position);
|
// eprintln!("Dragged: {:?}", position);
|
||||||
let height = self.scrollbar_thumb_height();
|
let height = self.scrollbar_thumb_height();
|
||||||
let grab = self.thumb_grab;
|
let grab = self.thumb_grab;
|
||||||
self.scroll_to_thumb(position.y.saturating_sub(grab), height);
|
self.scroll_to_thumb(position.y.saturating_sub(grab), height);
|
||||||
|
Loading…
Reference in New Issue
Block a user