On Sat, 2005-04-02 at 19:52, Martin Vermeer wrote:
> On Sat, Apr 02, 2005 at 01:11:29PM +0000, Angus Leeming wrote:

...

> I implemented this, tested and it works precisely as planned. Attached.
> 
> Georg, would you please put your existing patch in soon? This one clashes
> with it (or my local version of part of it) in math_amsarray.C, as you 
> can see in the attached. I'll resolve the conflict then.
> 
> - Martin
> 
> 
> ______________________________________________________________________
A slightly modified patch for this is in. Attached.

- Martin
Index: math_amsarrayinset.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_amsarrayinset.C,v
retrieving revision 1.27
diff -u -r1.27 math_amsarrayinset.C
--- math_amsarrayinset.C	3 Apr 2005 12:07:49 -0000	1.27
+++ math_amsarrayinset.C	4 Apr 2005 07:11:54 -0000
@@ -91,7 +91,7 @@
 
 void MathAMSArrayInset::draw(PainterInfo & pi, int x, int y) const
 {
-	MathGridInset::draw(pi, x + 6, y);
+	MathGridInset::drawWithMargin(pi, x, y, 6, 6);
 	int const yy = y - dim_.ascent();
 	mathed_draw_deco(pi, x + 1, yy, 5, dim_.height(), name_left());
 	mathed_draw_deco(pi, x + dim_.width() - 6, yy, 5, dim_.height(), name_right());
Index: math_gridinset.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_gridinset.C,v
retrieving revision 1.157
diff -u -r1.157 math_gridinset.C
--- math_gridinset.C	3 Apr 2005 12:07:49 -0000	1.157
+++ math_gridinset.C	4 Apr 2005 07:11:54 -0000
@@ -479,21 +479,28 @@
 
 void MathGridInset::draw(PainterInfo & pi, int x, int y) const
 {
+	drawWithMargin(pi, x, y, 0, 0);
+}
+
+void MathGridInset::drawWithMargin(PainterInfo & pi, int x, int y, 
+	int lmargin, int rmargin) const
+{
 	for (idx_type idx = 0; idx < nargs(); ++idx)
-		cell(idx).draw(pi, x + cellXOffset(idx), y + cellYOffset(idx));
+		cell(idx).draw(pi, x + lmargin + cellXOffset(idx), 
+			y + cellYOffset(idx));
 
 	for (row_type row = 0; row <= nrows(); ++row)
 		for (unsigned int i = 0; i < rowinfo_[row].lines_; ++i) {
 			int yy = y + rowinfo_[row].offset_ - rowinfo_[row].ascent_
 				- i * hlinesep() - hlinesep()/2 - rowsep()/2;
-			pi.pain.line(x + 1, yy,
-				     x + dim_.width() - 1, yy,
+			pi.pain.line(x + lmargin + 1, yy,
+				     x + dim_.width() - rmargin - 1, yy,
 				     LColor::foreground);
 		}
 
 	for (col_type col = 0; col <= ncols(); ++col)
 		for (unsigned int i = 0; i < colinfo_[col].lines_; ++i) {
-			int xx = x + colinfo_[col].offset_
+			int xx = x + lmargin + colinfo_[col].offset_
 				- i * vlinesep() - vlinesep()/2 - colsep()/2;
 			pi.pain.line(xx, y - dim_.ascent() + 1,
 				     xx, y + dim_.descent() - 1,
Index: math_gridinset.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_gridinset.h,v
retrieving revision 1.86
diff -u -r1.86 math_gridinset.h
--- math_gridinset.h	14 Feb 2005 14:25:17 -0000	1.86
+++ math_gridinset.h	4 Apr 2005 07:11:54 -0000
@@ -98,6 +98,9 @@
 	///
 	void draw(PainterInfo & pi, int x, int y) const;
 	///
+	void drawWithMargin(PainterInfo & pi, int x, int y, 
+		int lmargin = 0, int rmargin = 0) const;
+	///
 	void metricsT(TextMetricsInfo const & mi, Dimension & dim) const;
 	///
 	void drawT(TextPainter & pi, int x, int y) const;
Index: math_casesinset.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_casesinset.C,v
retrieving revision 1.29
diff -u -r1.29 math_casesinset.C
--- math_casesinset.C	3 Apr 2005 12:07:49 -0000	1.29
+++ math_casesinset.C	4 Apr 2005 07:11:54 -0000
@@ -58,7 +58,7 @@
 void MathCasesInset::draw(PainterInfo & pi, int x, int y) const
 {
 	mathed_draw_deco(pi, x + 1, y - dim_.ascent(), 6, dim_.height(), "{");
-	MathGridInset::draw(pi, x + 8, y);
+	MathGridInset::drawWithMargin(pi, x, y, 8, 0);
 	setPosCache(pi, x, y);
 }
 
Index: ChangeLog
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/ChangeLog,v
retrieving revision 1.483
diff -u -r1.483 ChangeLog
--- ChangeLog	3 Apr 2005 12:07:49 -0000	1.483
+++ ChangeLog	4 Apr 2005 07:11:55 -0000
@@ -1,3 +1,11 @@
+
+2005-04-04  Martin Vermeer  <[EMAIL PROTECTED]>
+	* math_amsarrayinset.C:
+	* math_casesinset.C:
+	* math_gridinset.C:
+	* math_gridinset.h: Add drawWithMargin method for use by
+	AMSArray and Cases, to position corner markers right
+
 2005-03-31  Georg Baum  <[EMAIL PROTECTED]>
 
 	* math_amsarrayinset.[Ch], math_tabularinset.[Ch],

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to