Skip to content

Commit

Permalink
Fix comment bottom padding
Browse files Browse the repository at this point in the history
  • Loading branch information
maxroehrl committed Sep 18, 2020
1 parent c31f03c commit 9f40b52
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/components/Comment.vue
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ export default {
},
refreshLabel(tv, comment) {
tv.setDepth(comment.depth);
tv.setDepth(comment.depth, 50);
Markdown.setMarkdown(tv, comment.body);
},
Expand Down
6 changes: 4 additions & 2 deletions app/components/IndentedLabel.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,18 @@ export default class IndentedLabel extends Label {
createNativeView() {
const TV = android.widget.TextView.extend({
depth: 0,
paddingBottom: 10,
onDraw(canvas) {
this.super.setPadding(factor * this.depth + 20, 0, 10, 10);
this.super.setPadding(factor * this.depth + 20, 0, 10, this.paddingBottom);
this.super.onDraw(canvas);
for (let i = 1; i <= this.depth; i++) {
const indent = i * factor;
canvas.drawLine(indent, 0, indent, this.super.getHeight(), paint);
}
},
setDepth(depth) {
setDepth(depth, paddingBottom=10) {
this.depth = depth;
this.paddingBottom = paddingBottom;
},
});
return new TV(this._context);
Expand Down

0 comments on commit 9f40b52

Please sign in to comment.