fix scaled rotate handle

Signed-off-by: Victor Seiji Hariki <victorseijih@gmail.com>
This commit is contained in:
Victor Seiji Hariki 2023-01-12 23:41:01 -03:00
parent b590b6d124
commit 51095160f1
4 changed files with 9 additions and 7 deletions

View file

@ -370,7 +370,7 @@
<!-- Load Tools --> <!-- Load Tools -->
<script <script
src="js/ui/tool/generic.js?v=f5ad9d7" src="js/ui/tool/generic.js?v=3e678e0"
type="text/javascript"></script> type="text/javascript"></script>
<script src="js/ui/tool/dream.js?v=f20dd01" type="text/javascript"></script> <script src="js/ui/tool/dream.js?v=f20dd01" type="text/javascript"></script>
@ -383,7 +383,7 @@
<script <script
src="js/ui/tool/select.js?v=95eba41" src="js/ui/tool/select.js?v=95eba41"
type="text/javascript"></script> type="text/javascript"></script>
<script src="js/ui/tool/stamp.js?v=1bba5f4" type="text/javascript"></script> <script src="js/ui/tool/stamp.js?v=4a86ff8" type="text/javascript"></script>
<script <script
src="js/ui/tool/interrogate.js?v=e579ff1" src="js/ui/tool/interrogate.js?v=e579ff1"
type="text/javascript"></script> type="text/javascript"></script>

View file

@ -399,10 +399,12 @@ const _tool = {
} }
hoveringRotateHandle(x, y, scale = 1) { hoveringRotateHandle(x, y, scale = 1) {
const localc = this.matrix.inverse().transformPoint({x, y}); const localc = this.rtmatrix.inverse().transformPoint({x, y});
const localrh = { const localrh = {
x: 0, x: 0,
y: -this.canvas.height / 2 - config.rotateHandleDistance * scale, y:
(-this.scale.y * this.canvas.height) / 2 -
config.rotateHandleDistance * scale,
}; };
const dx = Math.abs(localc.x - localrh.x); const dx = Math.abs(localc.x - localrh.x);

View file

@ -472,7 +472,7 @@ const stampTool = () =>
min: 0.01, min: 0.01,
max: 10, max: 10,
step: 0.1, step: 0.1,
textStep: 0.01, textStep: 0.001,
}); });
state.ctxmenu.scaleSlider = scaleSlider.slider; state.ctxmenu.scaleSlider = scaleSlider.slider;
state.setScale = scaleSlider.setValue; state.setScale = scaleSlider.setValue;

View file

@ -8,8 +8,8 @@
<iframe <iframe
id="openoutpaint" id="openoutpaint"
style="width: 100%; height: 800px" style="width: 100%; height: 800px"
src="../index.html?v=95a96ad" src="../index.html?v=daf18de"
src="../index.html?v=95a96ad" src="../index.html?v=daf18de"
frameborder="0"></iframe> frameborder="0"></iframe>
<button id="add-res">Add Resource</button> <button id="add-res">Add Resource</button>
<script> <script>