mirror of
https://github.com/chartjs/Chart.js.git
synced 2026-02-01 17:47:09 +00:00
Alias the pixel for nicer drawing
This commit is contained in:
parent
f2899934db
commit
754268890b
@ -637,8 +637,12 @@
|
||||
|
||||
if (this.isHorizontal()) {
|
||||
y1 = y2 = this.options.position === 'top' ? this.bottom : this.top;
|
||||
y1 += helpers.aliasPixel(this.ctx.lineWidth);
|
||||
y2 += helpers.aliasPixel(this.ctx.lineWidth);
|
||||
} else {
|
||||
x1 = x2 = this.options.position === 'left' ? this.right : this.left;
|
||||
x1 += helpers.aliasPixel(this.ctx.lineWidth);
|
||||
x2 += helpers.aliasPixel(this.ctx.lineWidth);
|
||||
}
|
||||
|
||||
this.ctx.moveTo(x1, y1);
|
||||
|
||||
@ -986,10 +986,10 @@ describe('Linear Scale', function() {
|
||||
"args": ["rgba(0, 0, 0, 0.1)"]
|
||||
}, {
|
||||
"name": "moveTo",
|
||||
"args": [0, 100]
|
||||
"args": [0, 100.5]
|
||||
}, {
|
||||
"name": "lineTo",
|
||||
"args": [200, 100]
|
||||
"args": [200, 100.5]
|
||||
}, {
|
||||
"name": "stroke",
|
||||
"args": []
|
||||
@ -1059,10 +1059,10 @@ describe('Linear Scale', function() {
|
||||
"args": ["rgba(0, 0, 0, 0.1)"]
|
||||
}, {
|
||||
"name": "moveTo",
|
||||
"args": [0, 100]
|
||||
"args": [0, 100.5]
|
||||
}, {
|
||||
"name": "lineTo",
|
||||
"args": [200, 100]
|
||||
"args": [200, 100.5]
|
||||
}, {
|
||||
"name": "stroke",
|
||||
"args": []
|
||||
@ -1518,10 +1518,10 @@ describe('Linear Scale', function() {
|
||||
"args": ["rgba(0, 0, 0, 0.1)"]
|
||||
}, {
|
||||
"name": "moveTo",
|
||||
"args": [30, 0]
|
||||
"args": [30.5, 0]
|
||||
}, {
|
||||
"name": "lineTo",
|
||||
"args": [30, 300]
|
||||
"args": [30.5, 300]
|
||||
}, {
|
||||
"name": "stroke",
|
||||
"args": []
|
||||
@ -1649,10 +1649,10 @@ describe('Linear Scale', function() {
|
||||
"args": ["rgba(0, 0, 0, 0.1)"]
|
||||
}, {
|
||||
"name": "moveTo",
|
||||
"args": [30, 0]
|
||||
"args": [30.5, 0]
|
||||
}, {
|
||||
"name": "lineTo",
|
||||
"args": [30, 300]
|
||||
"args": [30.5, 300]
|
||||
}, {
|
||||
"name": "stroke",
|
||||
"args": []
|
||||
@ -1906,10 +1906,10 @@ describe('Linear Scale', function() {
|
||||
"args": ["rgba(0, 0, 0, 0.1)"]
|
||||
}, {
|
||||
"name": "moveTo",
|
||||
"args": [30, 0]
|
||||
"args": [30.5, 0]
|
||||
}, {
|
||||
"name": "lineTo",
|
||||
"args": [30, 300]
|
||||
"args": [30.5, 300]
|
||||
}, {
|
||||
"name": "stroke",
|
||||
"args": []
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user