nroduit / Weasis

Weasis is a DICOM viewer available as a desktop application or as a web-based application.
https://nroduit.github.io
Other
828 stars 295 forks source link

PonitGraph cant be valid instantly after activating it by mouse click. #527

Closed a347807131 closed 7 months ago

a347807131 commented 7 months ago

Describe the bug. What happened?

I was hoping to develop a feature which was able to put label on image with just one click, so i found PointGraph, here comes the debug details.


There is a bug in the point label function. When the new shape and old shape are equal, the firePropertyChange method of propertyChangeSupport will not be executed as scheduled. image After pointGraph generate the graph copy, it will add propertyChangeListener to the new graph copy, but the shape of the copy was already made in the copy process , so PropertyChangeHandler will not be executed.
image

Next, procedure calls buildShape, the firePropertyChange doesnt run as i descriped first.

as a result, point graph label will not be directly rendered after mouse click.

here's my simple solution, make the method prepareShape of PointGraph invalid.

image

What version of Weasis are you running?

4.1.2

On which system the problem occurs?

Windows

Relevant log output

No response

Additional contextual elements

No response

a347807131 commented 7 months ago

Here's the reoccurrence. https://github.com/nroduit/Weasis/assets/24996382/e96abcc5-75e7-4d16-9508-75d134fa7225

nroduit commented 7 months ago

PointGraphic is not an object that can be used for drawing, as it does not inherit methods for drawing with the mouse.

I can assist within the scope of the Weasis project, but not with issues outside that scope with other objectives. My priority is to support open-source developments that contribute to the common effort to improve Weasis. So if you want to add new features you can propose them through pull requests.

a347807131 commented 7 months ago

thanks.