Skip to content

Commit

Permalink
feat(picking): change trigger pick event from pointdown to pointtap
Browse files Browse the repository at this point in the history
to solve "if inspector->transform->blur in canvas, not undo" bug
  • Loading branch information
yyc-git committed Jan 20, 2019
1 parent b649cc5 commit dd10f12
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ let _handlePicking = (event: EventType.customEvent, engineState) => {
let initJob = (_, engineState) => {
let engineState =
ManageEventEngineService.onCustomGlobalEvent(
~eventName=EventEditorService.getPointDownEventName(),
~eventName=EventEditorService.getPointTapEventName(),
~handleFunc=
(. event, engineState) =>
MouseEventService.isLeftMouseButton(event) ?
Expand Down
2 changes: 1 addition & 1 deletion test/integration/job/initPickingJob_test.re
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ let _ =

describe("test find picked one", () => {
describe("should set finded one to current scene tree node", () => {
describe("if pointdown->mouse button isn't left button", () => {
describe("if pointtap->mouse button isn't left button", () => {
let _prepare = () =>
InitPickingJobTool.prepareOneGameObject(
~sandbox,
Expand Down
11 changes: 11 additions & 0 deletions test/integration/job/tool/InitPickingJobTool.re
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,17 @@ let triggerPicking = (sandbox, pageX, pageY, eventButton) => {
(),
),
);
EventTool.triggerDomEvent(
"click",
EventTool.getBody(),
MouseEventTool.buildMouseEvent(
~pageX,
~pageY,
~target,
~which=eventButton,
(),
),
);
};

let triggerPickingAndRestore = (~eventButton=1, ~sandbox, ~pageX, ~pageY, ()) => {
Expand Down

0 comments on commit dd10f12

Please sign in to comment.