Is there a way to show just a rotating point in js fabric?
2 answers
Or like this:
var canvas = window._canvas = new fabric.Canvas('c');
var circle = new fabric.Circle({
left: 50,
top: 50,
radius: 25,
fill: 'rgba(0,255,0,0.5)',
});
circle.setControlsVisibility({
mt: false,
mb: false,
ml: false,
mr: false,
tr: false,
tl: false,
br: false,
bl: false,
mtr: true //the rotating point (defaut: true)
});
canvas.add(circle);
canvas {
border: 1px solid #999;
}
<script src="https://rawgit.com/kangax/fabric.js/master/dist/fabric.js"></script>
<canvas id="c" width="400" height="200"></canvas>
"mtr" is the pivot point.
+3
source to share