Skip to content

Commit

Permalink
fix: exclude Graphic padding from paddingColor
Browse files Browse the repository at this point in the history
  • Loading branch information
johsi-k committed Mar 17, 2020
1 parent 8be1aaa commit 679aaba
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 10 deletions.
6 changes: 4 additions & 2 deletions src/components/Core/Section/Section.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,10 @@
<defs>
<mask id={`mask-${sectionId}-padding-bg`}>
<rect
width="100%"
height="100%"
x={Math.min(scaledCoordinates.x1, scaledCoordinates.x2)}
y={Math.min(scaledCoordinates.y1, scaledCoordinates.y2)}
width={Math.abs(scaledCoordinates.x2 - scaledCoordinates.x1)}
height={Math.abs(scaledCoordinates.y2 - scaledCoordinates.y1)}
fill="white" />
<rect
x={Math.min(...rangeX)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ exports[`Assertions > Area Tests > [render] area snapshot correctly #0`] = `
<svg width="700" height="500">
<defs>
<mask id="mask-sc0-padding-bg">
<rect width="100%" height="100%" fill="white"></rect>
<rect x="0" y="0" width="700" height="500" fill="white"></rect>
<rect x="30" y="20" width="650" height="450" fill="black"></rect>
</mask>
<clipPath id="clip-sc0-data">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ exports[`Assertions > AreaLayer Tests > [render] area layer snapshot correctly #
<svg width="700" height="500">
<defs>
<mask id="mask-sc0-padding-bg">
<rect width="100%" height="100%" fill="white"></rect>
<rect x="0" y="0" width="700" height="500" fill="white"></rect>
<rect x="30" y="20" width="650" height="450" fill="black"></rect>
</mask>
<clipPath id="clip-sc0-data">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ exports[`Assertions > Geo Tests > [render] geo polygons correctly #0`] = `
<svg width="500" height="500">
<defs>
<mask id="mask-sc0-padding-bg">
<rect width="100%" height="100%" fill="white"></rect>
<rect x="0" y="0" width="500" height="500" fill="white"></rect>
<rect x="0" y="0" width="500" height="500" fill="black"></rect>
</mask>
<clipPath id="clip-sc0-data">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ exports[`Assertions > Label Mark Tests > [render] labels snapshot correctly #0`]
<svg width="500" height="500">
<defs>
<mask id="mask-sc0-padding-bg">
<rect width="100%" height="100%" fill="white"></rect>
<rect x="50" y="50" width="400" height="400" fill="white"></rect>
<rect x="50" y="50" width="400" height="400" fill="black"></rect>
</mask>
<clipPath id="clip-sc0-data">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ exports[`Assertions > Rectangle Tests > [render] rectangles snapshot correctly #
<svg width="500" height="500">
<defs>
<mask id="mask-sc0-padding-bg">
<rect width="100%" height="100%" fill="white"></rect>
<rect x="50" y="50" width="400" height="400" fill="white"></rect>
<rect x="50" y="50" width="400" height="400" fill="black"></rect>
</mask>
<clipPath id="clip-sc0-data">
Expand Down
2 changes: 1 addition & 1 deletion test/sandbox/src/examples/SelectPolygon.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
let highlightLine
</script>

<Graphic width={500} height={500}>
<Graphic width={500} height={500} padding={30}>

<Section
bind:this={section}
Expand Down
3 changes: 1 addition & 2 deletions test/sandbox/src/examples/SelectRectangle.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,10 @@
let highlightLine
</script>

<Graphic width={500} height={500}>
<Graphic width={500} height={500} padding={30}>

<Section
bind:this={section}
padding={30}
scaleX={scaleLinear().domain([0, 10])}
scaleY={scaleLinear().domain([0, 10])}
{onMousedown}
Expand Down

0 comments on commit 679aaba

Please sign in to comment.