David PHAM-VAN

Fix context painting empty Table

@@ -9,6 +9,7 @@ @@ -9,6 +9,7 @@
9 - Optimize file size 9 - Optimize file size
10 - Add PdfColor.shade 10 - Add PdfColor.shade
11 - Uniformize examples 11 - Uniformize examples
  12 +- Fix context painting empty Table
12 13
13 ## 1.5.0 14 ## 1.5.0
14 15
@@ -409,16 +409,16 @@ class Table extends Widget implements SpanningWidget { @@ -409,16 +409,16 @@ class Table extends Widget implements SpanningWidget {
409 void paint(Context context) { 409 void paint(Context context) {
410 super.paint(context); 410 super.paint(context);
411 411
  412 + if (_context.lastLine == 0) {
  413 + return;
  414 + }
  415 +
412 final Matrix4 mat = Matrix4.identity(); 416 final Matrix4 mat = Matrix4.identity();
413 mat.translate(box.x, box.y); 417 mat.translate(box.x, box.y);
414 context.canvas 418 context.canvas
415 ..saveContext() 419 ..saveContext()
416 ..setTransform(mat); 420 ..setTransform(mat);
417 421
418 - if (_context.lastLine == 0) {  
419 - return;  
420 - }  
421 -  
422 int index = 0; 422 int index = 0;
423 for (TableRow row in children) { 423 for (TableRow row in children) {
424 if (index++ < _context.firstLine && !row.repeat) { 424 if (index++ < _context.firstLine && !row.repeat) {