Closed lorenzgerber closed 2 months ago
@yashTEF The buffer works fine, but there seems to be an issue with macOS. I could imagine, that this is related to the following issue under macOS: https://github.com/eclipse/swtchart/issues/86
I looked up the mentioned issue,Seems like a problem in the
getImageData()
method of the plot area.However I compared the implementation to the one in ImageSupplier and the only difference I can find is that plot area is not redrawn before converting into image data.
Example in ImageSupplier-
baseChart.redraw()
baseChart.update()
@yashTEF - how do I test this with SWTChart repository? (e.g. not dowloading chemclipse) I'd love to continue to use SWTChart on macOS
@buchen You can start SWTChart directly from the source code, either run it as an Eclipse application or use the DemoChart plain java application.
To test the buffered selection, it needs to be enabled via the IChartSettings:
IChartSettings chartSettings = scrollableChart.getChartSettings();
chartSettings.setBufferSelection(true);
scrollableChart.applySettings(chartSettings);
I can confirm there is a problem if I a) activate the buffer selection and b) remove the test for macOS in the ChartSetting class. I can also confirm that it works if I leave the check for the macOS active.
I have made three screenshots:
To me it looks like the buffering has problems with the retina solution. If you have a look at the second image, you notice that the grid is (almost) twice as big and the text is much bigger? Maybe the buffer image has the right resolution but is not painted with the correct resolution?
@buchen Thanks for testing. We will have a look at this issue.
This Problem does not occur anymore hence the workaround has been removed: https://github.com/eclipse/swtchart/pull/412.
When using swtchart in openchrom/chemclipse (https://github.com/eclipse/chemclipse) on OSX, the drawing (eg chromatogram) disappears when clicking into the graph for selection/zooming. After releasing the mouse button, the drawing will appear again.