apsavin / jcanvascript Goto Github PK
View Code? Open in Web Editor NEWHTML5 Canvas JavaScript library
Home Page: http://jcscript.com
HTML5 Canvas JavaScript library
Home Page: http://jcscript.com
jCanvaScript is a JavaSript library that provides you methods to manage with the content of a HTML5 canvas element. Documentation and examples: http://jcscript.com/documentation You may use jCanvaScript library under the terms of either the MIT License or the GNU General Public License (GPL) Version 2.
Hi,
if the canvas is inside a div that can be scrolled the mouse position is no longer correct.
I think it can be solved with the solution posted in http://stackoverflow.com/questions/4962710/get-mouse-position-in-scrollable-div but I can't see how to inject the mouse position by myself?
Thanks in advance
None of the Image demos on the following documentation page work in Chrome:
http://jcscript.com/documentation/objects/image
They do work in Firefox.
I have a fairly complex scenario so I will talk though it and hopefully you will be able to see where the problem is.
I have a canvas drawn with multiple circles drawn.
A single click on certain circles turns them red - this works initially.
A double click on certain circles will cause the JCanvaScript to be cleared and redrawn (re-centred on the object that was double clicked). Not sure if it is important but I keep a reference to the circles which is overwritten when the scene is built again.
Once a double click event has been fired the double click events (on the new objects) continue to work - but the single click doesn't. I have tested various combinations and it doesn't seem to matter if the click and double click events are on different objects or not.
If I change the clear and redraw event to fire on a single click it all works as expected - it seems to be that the double click breaks the single click handling.
Let me know if I can send you any more info - unfortunately the example I have is integrated with lots of AJAX calls etc. so hard to send a working (or not working sample) but if you need one I will create a simpler mock-up.
Thanks!
Trying to get out the x.val and y.val from an draggable object while being dragged, but the values are always same same as when you placed the object. Translate does updated the values, but not draggable.
Only tested in Chrome (9.0.597.102)
When clicking on a draggable object, it keeps being dragged even after you've released the mouse button.
The problem occurs in Google Chrome (9.0.597.107).
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Something</title>
</head>
<body>
<canvas width="900" height="800" id="canvas"></canvas>
<script src="jCanvasScript.1.1.1.js"></script>
<script>
jc.start('canvas', 25);
jc.circle(150, 100, 50, '#000', true).id('circle');
engine.redraw('canvas');
jc('#circle').draggable();
</script>
</body>
</html>
Hi,
Is therre a way to stop/cancel a dragging operation (so that the callbacks get fired) if the mouse leaves the canvas?
(I'm using 1.5.15)
Thanks in advance
I think will be good to support dashed lines drawing in jCanvaScript.
Like:
jc.line([[1,2],[3,4]]).lineStyle({ dashed:true })
Example: http://www.rgraph.net/blog/2013/january/html5-canvas-dashed-lines.html
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.