QCustomPlot Discussion and Comments

Floating Point Coordinate SystemReturn to overview

Hi

Is there a reason to explain why the QCP coordinate system is based on integer (QRect, QPoint...) ?

I have some issues with QCPLayoutGrid as it rounds the calculated section sizes, and in my case, the total size is bigger than the layout dimension.

I was about to modify QCP to use floating point precision but does anybody know if there are some drawbacks ? (performances mainly)

Thanks

I just modified the code to use floating point precision, starting by changing mRect and mOuterRect types to QRectF. Then i had to modify a bunch of attributes and methods to take this change in consideration (QSize to QSizeF, QPoint to QPointF...) and everything seem to work properly.

My grid has now the right behavior (after removing the rounding step). I have some visual differences due to the differences between QRect and QRectF but for my use case its worth the modification. (bottom() and right() deviation for QRect)

Will see over time if i discover unexpected behaviors and post them here.