git: 9front

Download patch

ref: 2b1fe7f6b1dc06331bbcbb9763a3399d354ec32d
parent: c591073e7524916e62f6ffafd1527bf1f01f41ea
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Sun Jan 5 22:56:45 EST 2014

libframe: avoid _frcanfit() call in frdelete()

no need to calculate number of runes to fit in
box when box contains no runes.

--- a/sys/src/libframe/frdelete.c
+++ b/sys/src/libframe/frdelete.c
@@ -46,13 +46,13 @@
 	while(pt1.x!=pt0.x && n1<f->nbox){
 		_frcklinewrap0(f, &pt0, b);
 		_frcklinewrap(f, &pt1, b);
-		n = _frcanfit(f, pt0, b);
-		if(n==0)
-			drawerror(f->display, "_frcanfit==0");
 		r.min = pt0;
 		r.max = pt0;
 		r.max.y += f->font->height;
 		if(b->nrune > 0){
+			n = _frcanfit(f, pt0, b);
+			if(n==0)
+				drawerror(f->display, "_frcanfit==0");
 			if(n != b->nrune){
 				_frsplitbox(f, n1, n);
 				b = &f->box[n1];
--