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

Solved issue #411 #449

Merged
merged 8 commits into from
Nov 25, 2019
Merged

Solved issue #411 #449

merged 8 commits into from
Nov 25, 2019

Conversation

sarthak-g
Copy link
Contributor

Added fullscreen and unfullscreen button in Gears Activity as mentioned in issue #411

gear1

gear2

@llaske
Copy link
Owner

llaske commented Nov 20, 2019

That's the idea.
But there is an error in the console when clicking on fullscreen/unfullscreen button:

activity.js:126 Uncaught ReferenceError: resizeHandler is not defined
    at HTMLButtonElement.<anonymous> (activity.js:126)

@sarthak-g
Copy link
Contributor Author

I've updated the code and made a commit.

@llaske
Copy link
Owner

llaske commented Nov 22, 2019

There is another issue: in fullscreen mode, the drawing is not aligned with the cursor. There is vertical shift to the size of the toolbar.

image

@sarthak-g
Copy link
Contributor Author

If vertical shift will not be done then blank space will display as below:
VerticalShiftNotDone
@canvasOffsetY in gearsketch_main.coffee gets value only when the page is displayed for first time (with toolbar), so when fullscreen is done then size of the canvas is not updated.
What I think is we've to call @updateCanvasSize() when fullscreen as well as unfullscreen button is pressed but for doing so we need jquery.

@llaske
Copy link
Owner

llaske commented Nov 24, 2019

Of course the vertical shift should be done but it should be take into account when mouse position is computed.
You're right, I guess the issue is related to the canvasOffsetY initialized here. This value should be updated each time there is a click on fullscreen/unfullscreen button.
Calling updateCanvasSize method of the gearSketch object, from the activity, could be a solution. I don't think you need jQuery since the gearSketch object is available from the activity.

@sarthak-g
Copy link
Contributor Author

sarthak-g commented Nov 24, 2019

Fullscreen is working as expected.
Although without calling updateCanvasSize, it is working fine but I add updateCanvasSize for future safety.

Copy link
Owner

@llaske llaske left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice job. It works now.
Could you fix indentation issue in the activity.js file.

activities/Gears.activity/js/activity.js Outdated Show resolved Hide resolved
activities/Gears.activity/js/activity.js Outdated Show resolved Hide resolved
activities/Gears.activity/js/activity.js Outdated Show resolved Hide resolved
activities/Gears.activity/js/activity.js Outdated Show resolved Hide resolved
@sarthak-g
Copy link
Contributor Author

Indentation issue resolved.

@llaske
Copy link
Owner

llaske commented Nov 25, 2019

Sorry, there is still a TAB instead of white spaces before lines document.getElementById("fullscreen-button"), }); and document.getElementById("unfullscreen-button")

See the screen capture of Atom editor below:

image

@sarthak-g
Copy link
Contributor Author

It is fine now I guess.
indent show spaces

@llaske
Copy link
Owner

llaske commented Nov 25, 2019

Cool. That's fine now.
Thanks.

@llaske llaske merged commit 913a878 into llaske:dev Nov 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants