Skip to content

Commit

Permalink
"Show type" option
Browse files Browse the repository at this point in the history
  • Loading branch information
smariel committed Dec 28, 2019
1 parent 5b4d67a commit 39ab508
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 6 additions & 1 deletion html/PTree.html
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@
</div>
<div id="item_alert" class="item_info">
<div class="item_info_data">

</div>
<div class="item_info_border"></div>
</div>
Expand Down Expand Up @@ -261,6 +261,11 @@ <h5 class="bottom_subtitle">Display</h5>
Custom Field
</label>
<br />
<label for="config_type">
<input id="config_type" data-config="show_type" type="checkbox" class="config_input config_checkbox" />
Item type
</label>
<br />
<label for="config_badges">
<input id="config_badges" data-config="show_badges" type="checkbox" class="config_input config_checkbox" />
Badges
Expand Down
7 changes: 6 additions & 1 deletion js/class.Canvas.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ class Canvas {
show_ref : true,
show_custom1 : true,
show_badges : true,
show_type : false,
align_load : false,
proportional : false,
loss_color : false,
Expand Down Expand Up @@ -137,13 +138,17 @@ class Canvas {
if ('' !== text) text += '\n';
text += item.characs.custom1;
}
if (this.config.show_type) {
if ('' !== text) text += '\n';
text += item.getType();
}

let itemText = new fabric.Text(text, Canvas.fabric_template.text);
itemText.set({
originX : 'center',
originY : 'center',
textAlign : 'center',
top : itemGeometry.yhalf,
top : itemGeometry.yhalf+1,
left : itemGeometry.xhalf,
fill : Util.getOpositeBorW(item_color),
fontSize : this.config.text_size
Expand Down

0 comments on commit 39ab508

Please sign in to comment.