File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -148,7 +148,7 @@ export class Tip extends Mark {
148
148
. data ( index )
149
149
. enter ( )
150
150
. append ( "g" )
151
- . attr ( "transform" , ( i ) => `translate(${ px ( i ) } ,${ py ( i ) } )` )
151
+ . attr ( "transform" , ( i ) => `translate(${ Math . round ( px ( i ) ) } ,${ Math . round ( py ( i ) ) } )` ) // crisp edges
152
152
. call ( applyDirectStyles , this )
153
153
. call ( ( g ) => g . append ( "path" ) . attr ( "filter" , pathFilter ) )
154
154
. call ( ( g ) =>
@@ -205,7 +205,8 @@ export class Tip extends Mark {
205
205
function postrender ( ) {
206
206
const { width, height} = dimensions . facet ?? dimensions ;
207
207
g . selectChildren ( ) . each ( function ( i ) {
208
- const { x : tx , width : w , height : h } = this . getBBox ( ) ;
208
+ let { x : tx , width : w , height : h } = this . getBBox ( ) ;
209
+ ( w = Math . round ( w ) ) , ( h = Math . round ( h ) ) ; // crisp edges
209
210
let a = anchor ; // use the specified anchor, if any
210
211
if ( a === undefined ) {
211
212
a = mark . previousAnchor ; // favor the previous anchor, if it fits
You can’t perform that action at this time.
0 commit comments