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

Fix terminal warnings and crosshair cursor after Image File is dragged into the canvas #591

Merged
merged 3 commits into from May 26, 2021

Conversation

ghost
Copy link

@ghost ghost commented May 23, 2021

Summary / How this PR fixes the problem?

After the modes manager has been implemented some code stayed outdated
This will deregister the insert mode after the canvas image has been created

Steps to Test

Drag an Image File into the canvas

Screenshots

image

Known Issues / Things To Do

No known issues

This PR fixes/implements the following bugs/features:

Fix terminal warnings and crosshair cursor after Image File is dragged into the canvas

  • Fixes Fix terminal warnings after Image File is dragged into the canvas
  • Crosshair cursor after Image File is dragged into the canvas

src/Lib/Canvas.vala Outdated Show resolved Hide resolved
@Alecaddd
Copy link
Member

Since you're improving this area, there a bunch of other strange issues happening that you could investigate.

First, we could move the window.event_bus.insert_item ("image"); outside the foreach loop since we don't need to re-set it for each image.

A couple of other problems appear when multiple images are dropped together.

  1. Some images are not fully sized as they end up with 1px by 1px size.
  2. Randomly, this error appears: Gtk-WARNING **: 21:47:38.979: drawing failure for widget 'AkiraLibCanvas': invalid matrix (not invertible) alongside others and the whole UI breaks.

I suspect there's a race issue with the generation of the pixbuf of each image.

@ghost
Copy link
Author

ghost commented May 25, 2021

Can you please open an Issue or a discussion with more info and ping me

@ghost
Copy link
Author

ghost commented May 25, 2021

I am currently investigating for the problem of the image with short height or short width
I did some investigation which lead me to know that when the height is shorter than the width and the width was resized to a number that made calculating the height a decimal which is less than 1 which in int gets converted to a 0 which breaks the whole app so I got an Idea before setting the pixpuf we will check if the calculated pixpuf height is less than a 1 then we set it to 1 and vice versa for the width

Comment on lines 111 to +112
// Let the app know that we're adding image items.
window.event_bus.insert_item ("image");

Copy link
Member

Choose a reason for hiding this comment

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

You moved the method but you forgot the comment.
I'll fix this, but try to be more aware of the code around and the structure you're touching.

@Alecaddd Alecaddd merged commit f5641a6 into akiraux:master May 26, 2021
@ghost ghost deleted the drag-drop-img-fix branch May 26, 2021 09:33
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.

None yet

1 participant