ref: 9c38a9649a00dd85689f55a1eef23a14cf5a82e3
parent: 7acb58322a1af09f7e371a7d955c34fb408368b2
author: aap <aap@papnet.eu>
date: Mon Sep 2 07:28:12 EDT 2024
call frclear in text. removed useless function for now (we can do better).
--- a/inc.h
+++ b/inc.h
@@ -77,7 +77,6 @@
void xscrdraw(Text *x);
void xscroll(Text *x, Mousectl *mc, int but);
void xscrolln(Text *x, int n);
-void xtickupdn(Text *x, int d);
void xshow(Text *x, uint q0);
void xplacetick(Text *x, uint q);
void xtype(Text *x, Rune r);
--- a/text.c
+++ b/text.c
@@ -10,6 +10,7 @@
void
xinit(Text *x, Rectangle textr, Rectangle scrollr, Font *ft, Image *b, Image **cols)
{
+ frclear(x, FALSE);
frinit(x, textr, ft, b, cols);
x->i = b;
x->scrollr = scrollr;
@@ -434,30 +435,6 @@
else
q0 = x->org+frcharofpt(x, Pt(x->Frame.r.min.x, x->Frame.r.min.y+n*x->font->height));
xsetorigin(x, q0, TRUE);
-}
-
-/* move tick up or down while staying at the same x position */
-void
-xtickupdn(Text *x, int d)
-{
- Point p;
- int py;
- uint q0;
-
- xshow(x, x->q0);
- p = frptofchar(x, x->q0-x->org);
- if(x->posx >= 0)
- p.x = x->posx;
- py = p.y;
- p.y += d*x->font->height;
- if(p.y < x->Frame.r.min.y ||
- p.y > x->Frame.r.max.y-x->font->height){
- xscrolln(x, d);
- p.y = py;
- }
- q0 = x->org+frcharofpt(x, p);
- xsetselect(x, q0, q0);
- x->posx = p.x;
}
static Text *selecttext;