Re: [andre.poenitz-H0bhvm5RIPI+B2oLq8eQJv4efur1V5z/s0AfqQuZ5sE-XMD5yJDbdMReXY1tMh2IBg@public.gmane.org: Re: [Bug 1798] New: cursor looks like it's outside of an inset]

2005-02-21 Thread Andre Poenitz
On Sun, Feb 20, 2005 at 02:21:33AM +, John Levon wrote:
 On Fri, Feb 18, 2005 at 09:23:43PM +0100, Andre Poenitz wrote:
 
Ok, then at least the --x; should have a comment on it.
   
   See attached. Committing now.
   
   André, I hope your cvs troubles are solved soon. I am not going to write 
   comments and changelogs for you forever ;-)
  
  No? 
  
  Why?
 
 I'd rather people consider my complaints about the commit...

Didn't you say 'better, but not perfect'? If so, committing the thing
seems to be an improvement.

Andre'


Re: [andre.poenitz-H0bhvm5RIPI+B2oLq8eQJv4efur1V5z/s0AfqQuZ5sE-XMD5yJDbdMReXY1tMh2IBg@public.gmane.org: Re: [Bug 1798] New: cursor looks like it's outside of an inset]

2005-02-21 Thread Andre Poenitz
On Sun, Feb 20, 2005 at 02:21:33AM +, John Levon wrote:
> On Fri, Feb 18, 2005 at 09:23:43PM +0100, Andre Poenitz wrote:
> 
> > > > Ok, then at least the --x; should have a comment on it.
> > > 
> > > See attached. Committing now.
> > > 
> > > André, I hope your cvs troubles are solved soon. I am not going to write 
> > > comments and changelogs for you forever ;-)
> > 
> > No? 
> > 
> > Why?
> 
> I'd rather people consider my complaints about the commit...

Didn't you say 'better, but not perfect'? If so, committing the thing
seems to be an improvement.

Andre'


Re: [andre.poenitz-H0bhvm5RIPI+B2oLq8eQJv4efur1V5z/s0AfqQuZ5sE-XMD5yJDbdMReXY1tMh2IBg@public.gmane.org: Re: [Bug 1798] New: cursor looks like it's outside of an inset]

2005-02-19 Thread Andre Poenitz
On Tue, Feb 15, 2005 at 09:00:53PM +0100, Michael Schmitt wrote:
 André, I hope your cvs troubles are solved soon. I am not going to write
 comments and changelogs for you forever ;-)
 
 It would ease Andre's life and reduce the download/upload times 
 significantly, if somebody committed up-to-date ./po/*.po files. (But 
 beware of the problem that I have mentioned some days ago; po file 
 generation seems to be broken right now)
 
 Alternatively, we could switch from CVS to Subversion (the latter works 
 very reliably now).

We are converting currently the whole company from whatever-kind-of
-manual/semi-manual/or-professional source control system to svn
and so far everybody seems to consider it as uniformly better than
everything they've used before. And I doubt there is any kind of scs
that was not used before there...

Andre', looking forward to a way to do a diff without network
connection... and file renaming...


Re: [andre.poenitz-H0bhvm5RIPI+B2oLq8eQJv4efur1V5z/s0AfqQuZ5sE-XMD5yJDbdMReXY1tMh2IBg@public.gmane.org: Re: [Bug 1798] New: cursor looks like it's outside of an inset]

2005-02-19 Thread Andre Poenitz
On Tue, Feb 15, 2005 at 08:57:26PM +0100, Georg Baum wrote:
 Am Dienstag, 15. Februar 2005 11:31 schrieb Lars Gullik Bjønnes:
  Ok, then at least the --x; should have a comment on it.
 
 See attached. Committing now.
 
 André, I hope your cvs troubles are solved soon. I am not going to write 
 comments and changelogs for you forever ;-)

No? 

Why?

Andre'


Re: [andre.poenitz-H0bhvm5RIPI+B2oLq8eQJv4efur1V5z/s0AfqQuZ5sE-XMD5yJDbdMReXY1tMh2IBg@public.gmane.org: Re: [Bug 1798] New: cursor looks like it's outside of an inset]

2005-02-19 Thread John Levon
On Fri, Feb 18, 2005 at 09:23:43PM +0100, Andre Poenitz wrote:

   Ok, then at least the --x; should have a comment on it.
  
  See attached. Committing now.
  
  André, I hope your cvs troubles are solved soon. I am not going to write 
  comments and changelogs for you forever ;-)
 
 No? 
 
 Why?

I'd rather people consider my complaints about the commit...

john


Re: [andre.poenitz-H0bhvm5RIPI+B2oLq8eQJv4efur1V5z/s0AfqQuZ5sE-XMD5yJDbdMReXY1tMh2IBg@public.gmane.org: Re: [Bug 1798] New: cursor looks like it's outside of an inset]

2005-02-19 Thread Andre Poenitz
On Tue, Feb 15, 2005 at 09:00:53PM +0100, Michael Schmitt wrote:
> >André, I hope your cvs troubles are solved soon. I am not going to write
> >comments and changelogs for you forever ;-)
> 
> It would ease Andre's life and reduce the download/upload times 
> significantly, if somebody committed up-to-date ./po/*.po files. (But 
> beware of the problem that I have mentioned some days ago; po file 
> generation seems to be broken right now)
> 
> Alternatively, we could switch from CVS to Subversion (the latter works 
> very reliably now).

We are converting currently the whole company from whatever-kind-of
-manual/semi-manual/or-"professional" source control system to svn
and so far everybody seems to consider it as uniformly better than
everything they've used before. And I doubt there is any kind of scs
that was not used before there...

Andre', looking forward to a way to do a diff without network
connection... and file renaming...


Re: [andre.poenitz-H0bhvm5RIPI+B2oLq8eQJv4efur1V5z/s0AfqQuZ5sE-XMD5yJDbdMReXY1tMh2IBg@public.gmane.org: Re: [Bug 1798] New: cursor looks like it's outside of an inset]

2005-02-19 Thread Andre Poenitz
On Tue, Feb 15, 2005 at 08:57:26PM +0100, Georg Baum wrote:
> Am Dienstag, 15. Februar 2005 11:31 schrieb Lars Gullik Bjønnes:
> > Ok, then at least the --x; should have a comment on it.
> 
> See attached. Committing now.
> 
> André, I hope your cvs troubles are solved soon. I am not going to write 
> comments and changelogs for you forever ;-)

No? 

Why?

Andre'


Re: [andre.poenitz-H0bhvm5RIPI+B2oLq8eQJv4efur1V5z/s0AfqQuZ5sE-XMD5yJDbdMReXY1tMh2IBg@public.gmane.org: Re: [Bug 1798] New: cursor looks like it's outside of an inset]

2005-02-19 Thread John Levon
On Fri, Feb 18, 2005 at 09:23:43PM +0100, Andre Poenitz wrote:

> > > Ok, then at least the --x; should have a comment on it.
> > 
> > See attached. Committing now.
> > 
> > André, I hope your cvs troubles are solved soon. I am not going to write 
> > comments and changelogs for you forever ;-)
> 
> No? 
> 
> Why?

I'd rather people consider my complaints about the commit...

john


Re: [andre.poenitz-H0bhvm5RIPI+B2oLq8eQJv4efur1V5z/s0AfqQuZ5sE-XMD5yJDbdMReXY1tMh2IBg@public.gmane.org: Re: [Bug 1798] New: cursor looks like it's outside of an inset]

2005-02-15 Thread Georg Baum
Am Dienstag, 15. Februar 2005 11:31 schrieb Lars Gullik Bjønnes:
 Ok, then at least the --x; should have a comment on it.

See attached. Committing now.

André, I hope your cvs troubles are solved soon. I am not going to write 
comments and changelogs for you forever ;-)


Georg
diff -p -r -U 3 -X excl.tmp lyx-1.4-clean/src/bufferview_funcs.C lyx-1.4-cvs/src/bufferview_funcs.C
--- lyx-1.4-clean/src/bufferview_funcs.C	2005-02-08 20:28:36.0 +0100
+++ lyx-1.4-cvs/src/bufferview_funcs.C	2005-02-15 20:07:26.0 +0100
@@ -174,7 +174,10 @@ Point coordOffset(DocIterator const  di
 		y += par.rows()[rit].height();
 	y += par.rows()[par.pos2row(sl.pos())].ascent();
 	x += dit.bottom().text()-cursorX(dit.bottom());
-	return Point(x,y);
+	// The following correction should not be there at all.
+	// The cusor looks much better with the -1, though.
+	--x;
+	return Point(x, y);
 }
 
 
diff -p -r -U 3 -X excl.tmp lyx-1.4-clean/src/ChangeLog lyx-1.4-cvs/src/ChangeLog
--- lyx-1.4-clean/src/ChangeLog	2005-02-15 18:35:48.0 +0100
+++ lyx-1.4-cvs/src/ChangeLog	2005-02-15 20:07:44.0 +0100
@@ -1,3 +1,7 @@
+2005-02-13  Andr Pnitz  [EMAIL PROTECTED]
+
+	* bufferview_funcs.C (coordOffset): improve cursor drawing
+
 2005-02-13  Andr Pnitz  [EMAIL PROTECTED]
 
 	* Cursor.[Ch] (fixIfBroken): new method, try to fix a broken cursor
diff -p -r -U 3 -X excl.tmp lyx-1.4-clean/src/insets/ChangeLog lyx-1.4-cvs/src/insets/ChangeLog
--- lyx-1.4-clean/src/insets/ChangeLog	2005-02-15 18:35:16.0 +0100
+++ lyx-1.4-cvs/src/insets/ChangeLog	2005-02-15 20:11:00.0 +0100
@@ -1,3 +1,9 @@
+2005-02-13  Andr Pnitz  [EMAIL PROTECTED]
+
+	* insettext.[Ch] (border_): new 
+	* insettext.C (metrics, draw, drawFrame, clearInset, getCursorPos):
+	use border_
+
 2005-02-14  Angus Leeming  [EMAIL PROTECTED]
 
 	* insetlatexaccent.C (draw): squash a couple of MSVC warnings
diff -p -r -U 3 -X excl.tmp lyx-1.4-clean/src/insets/insettext.C lyx-1.4-cvs/src/insets/insettext.C
--- lyx-1.4-clean/src/insets/insettext.C	2005-02-08 20:29:10.0 +0100
+++ lyx-1.4-cvs/src/insets/insettext.C	2005-02-15 20:04:12.0 +0100
@@ -70,6 +70,9 @@ using std::ostream;
 using std::vector;
 
 
+int InsetText::border_ = 2;
+
+
 InsetText::InsetText(BufferParams const  bp)
 	: drawFrame_(false), frame_color_(LColor::insetframe), text_(0)
 {
@@ -92,7 +95,8 @@ InsetText::InsetText(InsetText const  i
 }
 
 
-InsetText::InsetText() : text_(0)
+InsetText::InsetText()
+	: text_(0)
 {}
 
 
@@ -168,9 +172,14 @@ void InsetText::metrics(MetricsInfo  mi
 {
 	//lyxerr  InsetText::metrics: width:   mi.base.textwidth  endl;
 	setViewCache(mi.base.bv);
+	mi.base.textwidth -= 2 * border_;
 	font_ = mi.base.font;
 	text_.font_ = mi.base.font;
 	text_.metrics(mi, dim);
+	dim.asc += border_;
+	dim.des += border_;
+	dim.wid += 2 * border_;
+	mi.base.textwidth += 2 * border_;
 	dim_ = dim;
 }
 
@@ -185,10 +194,7 @@ void InsetText::draw(PainterInfo  pi, i
 	bv-hideCursor();
 
 	x += scroll();
-	//y -= text_.ascent();
-
-
-	text_.draw(pi, x, y);
+	text_.draw(pi, x + border_, y);
 
 	if (drawFrame_)
 		drawFrame(pi.pain, x, y);
@@ -206,18 +212,18 @@ void InsetText::drawSelection(PainterInf
 
 void InsetText::drawFrame(Painter  pain, int x, int y) const
 {
-	int const w = max(1, text_.width());
-	int const h = text_.height();
-	int const a = text_.ascent();
+	int const w = text_.width() + border_;
+	int const a = text_.ascent() + border_;
+	int const h = a + text_.descent() + border_;
 	pain.rectangle(x, y - a, w, h, frameColor());
 }
 
 
 void InsetText::clearInset(Painter  pain, int x, int y) const
 {
-	int const w = text_.width();
-	int const h = text_.height();
-	int const a = text_.ascent();
+	int const w = text_.width() + border_;
+	int const a = text_.ascent() + border_;
+	int const h = a + text_.descent() + border_;
 	pain.fillRectangle(x, y - a, w, h, backgroundColor());
 }
 
@@ -356,7 +362,7 @@ void InsetText::validate(LaTeXFeatures 
 
 void InsetText::getCursorPos(CursorSlice const  sl, int  x, int  y) const
 {
-	x = text_.cursorX(sl);
+	x = text_.cursorX(sl) + border_;
 	y = text_.cursorY(sl);
 }
 
diff -p -r -U 3 -X excl.tmp lyx-1.4-clean/src/insets/insettext.h lyx-1.4-cvs/src/insets/insettext.h
--- lyx-1.4-clean/src/insets/insettext.h	2004-12-19 11:37:17.0 +0100
+++ lyx-1.4-cvs/src/insets/insettext.h	2005-02-15 20:04:11.0 +0100
@@ -165,6 +165,8 @@ private:
 	int frame_color_;
 	///
 	mutable lyx::pit_type old_pit;
+	///
+	static int border_;
 public:
 	///
 	mutable LyXText text_;


Re: [andre.poenitz-H0bhvm5RIPI+B2oLq8eQJv4efur1V5z/s0AfqQuZ5sE-XMD5yJDbdMReXY1tMh2IBg@public.gmane.org: Re: [Bug 1798] New: cursor looks like it's outside of an inset]

2005-02-15 Thread Michael Schmitt
André, I hope your cvs troubles are solved soon. I am not going to write
comments and changelogs for you forever ;-)
It would ease Andre's life and reduce the download/upload times 
significantly, if somebody committed up-to-date ./po/*.po files. (But beware 
of the problem that I have mentioned some days ago; po file generation seems 
to be broken right now)

Alternatively, we could switch from CVS to Subversion (the latter works very 
reliably now).

Michael 



Re: [andre.poenitz-H0bhvm5RIPI+B2oLq8eQJv4efur1V5z/s0AfqQuZ5sE-XMD5yJDbdMReXY1tMh2IBg@public.gmane.org: Re: [Bug 1798] New: cursor looks like it's outside of an inset]

2005-02-15 Thread Georg Baum
Am Dienstag, 15. Februar 2005 11:31 schrieb Lars Gullik Bjønnes:
> Ok, then at least the --x; should have a comment on it.

See attached. Committing now.

André, I hope your cvs troubles are solved soon. I am not going to write 
comments and changelogs for you forever ;-)


Georg
diff -p -r -U 3 -X excl.tmp lyx-1.4-clean/src/bufferview_funcs.C lyx-1.4-cvs/src/bufferview_funcs.C
--- lyx-1.4-clean/src/bufferview_funcs.C	2005-02-08 20:28:36.0 +0100
+++ lyx-1.4-cvs/src/bufferview_funcs.C	2005-02-15 20:07:26.0 +0100
@@ -174,7 +174,10 @@ Point coordOffset(DocIterator const & di
 		y += par.rows()[rit].height();
 	y += par.rows()[par.pos2row(sl.pos())].ascent();
 	x += dit.bottom().text()->cursorX(dit.bottom());
-	return Point(x,y);
+	// The following correction should not be there at all.
+	// The cusor looks much better with the -1, though.
+	--x;
+	return Point(x, y);
 }
 
 
diff -p -r -U 3 -X excl.tmp lyx-1.4-clean/src/ChangeLog lyx-1.4-cvs/src/ChangeLog
--- lyx-1.4-clean/src/ChangeLog	2005-02-15 18:35:48.0 +0100
+++ lyx-1.4-cvs/src/ChangeLog	2005-02-15 20:07:44.0 +0100
@@ -1,3 +1,7 @@
+2005-02-13  André Pönitz  <[EMAIL PROTECTED]>
+
+	* bufferview_funcs.C (coordOffset): improve cursor drawing
+
 2005-02-13  André Pönitz  <[EMAIL PROTECTED]>
 
 	* Cursor.[Ch] (fixIfBroken): new method, try to fix a broken cursor
diff -p -r -U 3 -X excl.tmp lyx-1.4-clean/src/insets/ChangeLog lyx-1.4-cvs/src/insets/ChangeLog
--- lyx-1.4-clean/src/insets/ChangeLog	2005-02-15 18:35:16.0 +0100
+++ lyx-1.4-cvs/src/insets/ChangeLog	2005-02-15 20:11:00.0 +0100
@@ -1,3 +1,9 @@
+2005-02-13  André Pönitz  <[EMAIL PROTECTED]>
+
+	* insettext.[Ch] (border_): new 
+	* insettext.C (metrics, draw, drawFrame, clearInset, getCursorPos):
+	use border_
+
 2005-02-14  Angus Leeming  <[EMAIL PROTECTED]>
 
 	* insetlatexaccent.C (draw): squash a couple of MSVC warnings
diff -p -r -U 3 -X excl.tmp lyx-1.4-clean/src/insets/insettext.C lyx-1.4-cvs/src/insets/insettext.C
--- lyx-1.4-clean/src/insets/insettext.C	2005-02-08 20:29:10.0 +0100
+++ lyx-1.4-cvs/src/insets/insettext.C	2005-02-15 20:04:12.0 +0100
@@ -70,6 +70,9 @@ using std::ostream;
 using std::vector;
 
 
+int InsetText::border_ = 2;
+
+
 InsetText::InsetText(BufferParams const & bp)
 	: drawFrame_(false), frame_color_(LColor::insetframe), text_(0)
 {
@@ -92,7 +95,8 @@ InsetText::InsetText(InsetText const & i
 }
 
 
-InsetText::InsetText() : text_(0)
+InsetText::InsetText()
+	: text_(0)
 {}
 
 
@@ -168,9 +172,14 @@ void InsetText::metrics(MetricsInfo & mi
 {
 	//lyxerr << "InsetText::metrics: width: " << mi.base.textwidth << endl;
 	setViewCache(mi.base.bv);
+	mi.base.textwidth -= 2 * border_;
 	font_ = mi.base.font;
 	text_.font_ = mi.base.font;
 	text_.metrics(mi, dim);
+	dim.asc += border_;
+	dim.des += border_;
+	dim.wid += 2 * border_;
+	mi.base.textwidth += 2 * border_;
 	dim_ = dim;
 }
 
@@ -185,10 +194,7 @@ void InsetText::draw(PainterInfo & pi, i
 	bv->hideCursor();
 
 	x += scroll();
-	//y -= text_.ascent();
-
-
-	text_.draw(pi, x, y);
+	text_.draw(pi, x + border_, y);
 
 	if (drawFrame_)
 		drawFrame(pi.pain, x, y);
@@ -206,18 +212,18 @@ void InsetText::drawSelection(PainterInf
 
 void InsetText::drawFrame(Painter & pain, int x, int y) const
 {
-	int const w = max(1, text_.width());
-	int const h = text_.height();
-	int const a = text_.ascent();
+	int const w = text_.width() + border_;
+	int const a = text_.ascent() + border_;
+	int const h = a + text_.descent() + border_;
 	pain.rectangle(x, y - a, w, h, frameColor());
 }
 
 
 void InsetText::clearInset(Painter & pain, int x, int y) const
 {
-	int const w = text_.width();
-	int const h = text_.height();
-	int const a = text_.ascent();
+	int const w = text_.width() + border_;
+	int const a = text_.ascent() + border_;
+	int const h = a + text_.descent() + border_;
 	pain.fillRectangle(x, y - a, w, h, backgroundColor());
 }
 
@@ -356,7 +362,7 @@ void InsetText::validate(LaTeXFeatures &
 
 void InsetText::getCursorPos(CursorSlice const & sl, int & x, int & y) const
 {
-	x = text_.cursorX(sl);
+	x = text_.cursorX(sl) + border_;
 	y = text_.cursorY(sl);
 }
 
diff -p -r -U 3 -X excl.tmp lyx-1.4-clean/src/insets/insettext.h lyx-1.4-cvs/src/insets/insettext.h
--- lyx-1.4-clean/src/insets/insettext.h	2004-12-19 11:37:17.0 +0100
+++ lyx-1.4-cvs/src/insets/insettext.h	2005-02-15 20:04:11.0 +0100
@@ -165,6 +165,8 @@ private:
 	int frame_color_;
 	///
 	mutable lyx::pit_type old_pit;
+	///
+	static int border_;
 public:
 	///
 	mutable LyXText text_;


Re: [andre.poenitz-H0bhvm5RIPI+B2oLq8eQJv4efur1V5z/s0AfqQuZ5sE-XMD5yJDbdMReXY1tMh2IBg@public.gmane.org: Re: [Bug 1798] New: cursor looks like it's outside of an inset]

2005-02-15 Thread Michael Schmitt
André, I hope your cvs troubles are solved soon. I am not going to write
comments and changelogs for you forever ;-)
It would ease Andre's life and reduce the download/upload times 
significantly, if somebody committed up-to-date ./po/*.po files. (But beware 
of the problem that I have mentioned some days ago; po file generation seems 
to be broken right now)

Alternatively, we could switch from CVS to Subversion (the latter works very 
reliably now).

Michael