fix messagebyte size on high dpi screens
parent
125a6ebbf6
commit
a7be1cf2ef
|
@ -37,7 +37,7 @@ export default class MessageBytes extends Component {
|
|||
rowCount = Math.ceil(DbcUtils.maxMessageSize(this.props.message, this.state.maxMessageBytes) / 8);
|
||||
}
|
||||
if (this.canvas) {
|
||||
this.canvas.height = rowCount * 15 * window.devicePixelRatio;
|
||||
this.canvas.height = rowCount * 15;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -132,16 +132,14 @@ export default class MessageBytes extends Component {
|
|||
if (!ref) return;
|
||||
|
||||
this.canvas = ref;
|
||||
this.canvas.width = 160 * window.devicePixelRatio;
|
||||
this.canvas.width = 160;
|
||||
let rowCount;
|
||||
if (this.props.message.frame && this.props.message.frame.size) {
|
||||
rowCount = Math.ceil(this.props.message.frame.size / 8);
|
||||
} else {
|
||||
rowCount = Math.ceil(DbcUtils.maxMessageSize(this.props.message, this.state.maxMessageBytes) / 8);
|
||||
}
|
||||
this.canvas.height = rowCount * 15 * window.devicePixelRatio;
|
||||
const ctx = this.canvas.getContext('2d');
|
||||
ctx.scale(window.devicePixelRatio, window.devicePixelRatio);
|
||||
this.canvas.height = rowCount * 15;
|
||||
}
|
||||
|
||||
render() {
|
||||
|
|
Loading…
Reference in New Issue