Skip to content

Input field not selectable on canvas resize #23

Description

@iris-winter

When resizing the input scaled correctly but the "select" box to focus stays relative to the original canvas width.

Something like this fixes it . 1359 - 1362

 var self = this,
        relativeX = self._ctx.canvas ? self._x / ( self._ctx.canvas.width / self._ctx.canvas.offsetWidth) : self._x,
        relativeY = self._ctx.canvas ? self._y / ( self._ctx.canvas.height / self._ctx.canvas.offsetHeight) : self._y,
        xLeft = x >= relativeX + self._extraX,
        xRight = x <= relativeX + self._extraX + self._width + self._padding * 2,
        yTop = y >= relativeY + self._extraY,
        yBottom = y <= relativeY + self._extraY + self._height + self._padding * 2;

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions