Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
F
flot
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
HS-public
flot
Commits
739cefd5
Commit
739cefd5
authored
Dec 24, 2013
by
David Schnur
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add sub-pixel adjustments to avoid blurry markings.
Fixes #1210.
parent
e5d22378
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
14 deletions
+22
-14
jquery.flot.js
jquery.flot.js
+22
-14
No files found.
jquery.flot.js
View file @
739cefd5
...
...
@@ -1963,26 +1963,34 @@ Licensed under the MIT license.
yrange
.
from
=
Math
.
max
(
yrange
.
from
,
yrange
.
axis
.
min
);
yrange
.
to
=
Math
.
min
(
yrange
.
to
,
yrange
.
axis
.
max
);
if
(
xrange
.
from
==
xrange
.
to
&&
yrange
.
from
==
yrange
.
to
)
var
xequal
=
xrange
.
from
===
xrange
.
to
,
yequal
=
yrange
.
from
===
yrange
.
to
;
if
(
xequal
&&
yequal
)
{
continue
;
}
// then draw
xrange
.
from
=
xrange
.
axis
.
p2c
(
xrange
.
from
);
xrange
.
to
=
xrange
.
axis
.
p2c
(
xrange
.
to
);
yrange
.
from
=
yrange
.
axis
.
p2c
(
yrange
.
from
);
yrange
.
to
=
yrange
.
axis
.
p2c
(
yrange
.
to
);
if
(
xrange
.
from
==
xrange
.
to
||
yrange
.
from
==
yrange
.
to
)
{
// draw line
xrange
.
from
=
Math
.
floor
(
xrange
.
axis
.
p2c
(
xrange
.
from
));
xrange
.
to
=
Math
.
floor
(
xrange
.
axis
.
p2c
(
xrange
.
to
));
yrange
.
from
=
Math
.
floor
(
yrange
.
axis
.
p2c
(
yrange
.
from
));
yrange
.
to
=
Math
.
floor
(
yrange
.
axis
.
p2c
(
yrange
.
to
));
if
(
xequal
||
yequal
)
{
var
lineWidth
=
m
.
lineWidth
||
options
.
grid
.
markingsLineWidth
,
subPixel
=
lineWidth
%
2
?
0.5
:
0
;
ctx
.
beginPath
();
ctx
.
strokeStyle
=
m
.
color
||
options
.
grid
.
markingsColor
;
ctx
.
lineWidth
=
m
.
lineWidth
||
options
.
grid
.
markingsLineWidth
;
ctx
.
moveTo
(
xrange
.
from
,
yrange
.
from
);
ctx
.
lineTo
(
xrange
.
to
,
yrange
.
to
);
ctx
.
lineWidth
=
lineWidth
;
if
(
xequal
)
{
ctx
.
moveTo
(
xrange
.
to
+
subPixel
,
yrange
.
from
);
ctx
.
lineTo
(
xrange
.
to
+
subPixel
,
yrange
.
to
);
}
else
{
ctx
.
moveTo
(
xrange
.
from
,
yrange
.
to
+
subPixel
);
ctx
.
lineTo
(
xrange
.
to
,
yrange
.
to
+
subPixel
);
}
ctx
.
stroke
();
}
else
{
// fill area
}
else
{
ctx
.
fillStyle
=
m
.
color
||
options
.
grid
.
markingsColor
;
ctx
.
fillRect
(
xrange
.
from
,
yrange
.
to
,
xrange
.
to
-
xrange
.
from
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment