Skip to content

Commit

Permalink
fixed DataTable paging issue when drawing the last horizontal line
Browse files Browse the repository at this point in the history
  • Loading branch information
newk5 committed Aug 10, 2019
1 parent 479adce commit 3ebf010
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 13 deletions.
27 changes: 16 additions & 11 deletions script/decui/components/Table.nut
Original file line number Diff line number Diff line change
Expand Up @@ -336,19 +336,22 @@ class Table extends Component {

function nextPage(){
if (this.page < this.pages && !this.awatingResponse){

if (this.lazy){

this.lazyNextPage();
} else{

this.clear();
this.page++;
this.build(true);
if (this.page == this.pages){
UI.Sprite(this.id+"::table::nextBtn").Alpha = 100;
UI.Sprite(this.id+"::table::prevBtn").Alpha = 255;
}else{
UI.Sprite(this.id+"::table::prevBtn").Alpha = 255;
UI.Sprite(this.id+"::table::prevBtn").Alpha = 255;
}

UI.Label(this.id+"::table::pagesLabel").Text = "Page "+this.page+" of "+this.pages;

//re-apply table borders because the table size may change
Expand Down Expand Up @@ -1272,15 +1275,17 @@ class Table extends Component {
}

function drawHline(canvas, size, row,y) {

canvas.add(
UI.Canvas({
id =this.id+"::table::row:::line"+row,
Position = VectorScreen(0,y),
Size = VectorScreen(size,1),
Colour = Colour(0,0,0,150)
})
);
if (!UI.idExists(this.id+"::table::row:::line"+row)) {
canvas.add(
UI.Canvas({
id =this.id+"::table::row:::line"+row,
Position = VectorScreen(0,y),
Size = VectorScreen(size,1),
Colour = Colour(0,0,0,150)
})
);
}


}

Expand Down
3 changes: 1 addition & 2 deletions script/main.nut
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
dofile("decui/decui.nut");
dofile("debug.nut");

function Script::ScriptLoad(){



}


Expand Down

0 comments on commit 3ebf010

Please sign in to comment.