Skip to content

Commit

Permalink
Fixed the position of the livemap when the parent has the style 'text…
Browse files Browse the repository at this point in the history
…-align: center'.
  • Loading branch information
ASmirnov-HORIS committed Mar 29, 2024
1 parent 610af93 commit 1892961
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
1 change: 1 addition & 0 deletions js-package/src/jsMain/kotlin/FigureToHtml.kt
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ internal class FigureToHtml(
)

val liveMapReg = liveMapFigure.mapToCanvas(canvasControl)
liveMapDiv.style.display = "inline"
parentElement.appendChild(liveMapDiv)

liveMapDiv.onDisconnect(liveMapReg::dispose)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ import org.jetbrains.letsPlot.commons.intern.async.Asyncs
import org.jetbrains.letsPlot.commons.geometry.Vector
import org.jetbrains.letsPlot.platf.w3c.dom.css.setHeight
import org.jetbrains.letsPlot.platf.w3c.dom.css.setWidth
import org.jetbrains.letsPlot.platf.w3c.dom.css.setLeft
import org.jetbrains.letsPlot.platf.w3c.dom.css.setTop
import org.jetbrains.letsPlot.core.canvas.Canvas
import org.jetbrains.letsPlot.core.canvas.ScaledCanvas
import kotlinx.browser.document
Expand Down Expand Up @@ -58,8 +56,6 @@ internal class DomCanvas private constructor(
val canvasElement = document.createElement("canvas") as HTMLCanvasElement
canvasElement.style.setWidth(size.x)
canvasElement.style.setHeight(size.y)
canvasElement.style.setLeft(0.0)
canvasElement.style.setTop(0.0)

// TODO: fix it. With floor() there are gaps between tiles.
// element size type is int so use floor to make sure that the context2d will cover whole canvas
Expand Down

0 comments on commit 1892961

Please sign in to comment.