Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sketchpad.readOnly not working #26

Open
LDeeJay1969 opened this issue Dec 10, 2016 · 2 comments
Open

sketchpad.readOnly not working #26

LDeeJay1969 opened this issue Dec 10, 2016 · 2 comments
Labels

Comments

@LDeeJay1969
Copy link

I'm trying to disable the canvas to simulate the 'back' of a sketchbook on which you shouldn't be able to write . An underlying image is swapped to see the back of the drawing pad but after sketchpad.readOnly = true, you can still write on the canvas. I've created a workaround by setting sketchpad.color = 'rgba(255,255,255,0)'; so the pen becomes invisible (thanks to jeanleonino) .

As a test I've created a very minimalistic html source:

<body>
<canvas id="sketchpad"></canvas>
<script>
var sketchpad = new Sketchpad({
  element: '#sketchpad',
  width: 400,
  height: 400
});
sketchpad.readOnly = true;
</script>
</body>

This created a canvas on which you can write. Is my interpretation of readOnly incorrect or is this truly a bug?

@julen9601
Copy link

Hi, i know i am two or tree year late but, what if you just put a invisible div over the sketchpad

@safeerbhatti
Copy link

im many years late but i solved this by using
pointer-events: none on div

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants