wxMaxima-developers / wxmaxima

A gui for the computer algebra system Maxima built with wxWidgets
https://wxMaxima-developers.github.io/wxmaxima/
Other
471 stars 98 forks source link

Ugly integral sign #1812

Closed richardgobeli closed 10 months ago

richardgobeli commented 1 year ago

What happened to the integral sign? image image I also can't copy any output formulas like the build_info.
I needed to do a screen capture.

gunterkoenigsmann commented 1 year ago

The integral sign is a spline. How it looked was highly dependent on the screen resolution and the zoom factor. I corrected that and then tried to find points that make up a spline that at least half-way looked like a integral sign:

    wxPoint points[7] = {
      {sign.x + m_signWCenter + 2 * (m_signWidth / 4),
       sign.y - (m_signHeight - Scale_Px(1)) / 2 + m_signWidth / 4},
      {sign.x + m_signWCenter + m_signWidth / 4,
       sign.y - (m_signHeight - Scale_Px(1)) / 2},
      {sign.x + m_signWCenter, sign.y - (m_signHeight - Scale_Px(1)) / 2 +
       2 * (m_signWidth / 4) + Scale_Px(.35)},

      // The line
      {sign.x + m_signWCenter + Scale_Px(.5), sign.y},

      // Bottom Decoration
      {sign.x + m_signWCenter, sign.y + (m_signHeight - Scale_Px(1)) / 2 -
       2 * (m_signWidth / 4) + Scale_Px(.35)},
      {sign.x + m_signWCenter - m_signWidth / 4,
       sign.y + (m_signHeight - Scale_Px(1)) / 2},
      {sign.x + m_signWCenter - 2 * (m_signWidth / 4),
       sign.y + (m_signHeight - Scale_Px(1)) / 2 - m_signWidth / 4}};

Really happy with that outcome I am not => will one day to find better points, but would be happy if anybody else did before me.

gunterkoenigsmann commented 1 year ago

The copy issue I cannot reproduce with the current nightly build. I did resolve a copy issue a few days back and for a few days the nightly build wasn't working as maxima wouldn't build => that issue might be resolved in the code, already.

richardgobeli commented 12 months ago

The copy output now works.

Here is the result when the screen is enlarged to the point where the output goes past the right edge of the screen. I then make the screen smaller and now the output is messed up. image This is before enlarging past edge. image (%o3) build_info(version="branch_5_47_base_431_ge024c7557_dirty",timestamp="2023-10-05 23:54:01",host="x86_64-w64-mingw32",lisp_name="SBCL",lisp_version="2.3.2",maxima_userdir="C:/Users/Richard.000/maxima",maxima_tempdir="C:/Users/Richard.000/AppData/Local/Temp",maxima_objdir="C:/Users/Richard.000/maxima/binary/branch_5_47_base_431_ge024c7557_dirty/sbcl/2_3_2",maxima_frontend="wxMaxima",maxima_frontend_version="23.10.0_DevelopmentSnapshot_MSW")

gunterkoenigsmann commented 12 months ago

Wow... ...that kind of bug is hard to find. Thanks! But I believe it will be easy to fix. Will do so this weekend

gunterkoenigsmann commented 12 months ago

Wow... ...this was actually two bad bugs that have gone unnoticed for years. Thanks for finding them!

richardgobeli commented 12 months ago

I tested the rescaling and discovered this. The input and output parts of the cell somehow have different scales. The label spacing is also screwed up. image When I do the down arrow it gets corrected with a slight different scale. image This was a screen shot. image this is copy of build info. image image

gunterkoenigsmann commented 12 months ago

I have split the new issues into sub-issues - and believe to have already resolved one of them. The other (the vertical spacing) I don't seem to be able to reproduce, though.

richardgobeli commented 11 months ago

How was the integral sign displayed before these last changes? Can you duplicate the integral sign like it was before?

gunterkoenigsmann commented 11 months ago

Many fonts offer three characters: The top, the middle and the lower end of the integral sign. Sometimes these parts do not align properly, though. Insl some Fonts you get placeholders, instead.

gunterkoenigsmann commented 11 months ago

Insieme fonts they aligned, but only when positioned in a way that wxWidgets didn't detect. And if the font didn't offer them wxWidgets didn't detect that, neither so wxMaxima did render the chars and did some plausibility checks with the result. If that check failed wxMaxima did try to draw Integral signs using a spline and due to am error in the formula did actually do a great job on some systems and zoom factors.

daute commented 11 months ago

Maybe an SVG graphic instead of a spline is nicer? Is that possible? E.g. https://commons.wikimedia.org/wiki/File:Integral_Sign.svg

gunterkoenigsmann commented 11 months ago

Thought about that, too. But in the end that svg file would just contain a spline that hits the Right Points which means: just altering the list of points that make up the Integral should get us the result the SVG file gives. All we need is a good idea how our integral should look like.

richardgobeli commented 10 months ago

The position of the integral sign moves up when the scale of the text is made bigger. This is good at the default scale. image Here I zoomed in to make it bigger. The sign did not get bigger and it looks like it was pinned at the top. image

richardgobeli commented 10 months ago

Looks good now.

richardgobeli commented 10 months ago

Can you switch the color from black on a white background and gray on a black background?
It would look better with black here. image

gunterkoenigsmann commented 10 months ago

I believe that in the next Nightly Build the color will be correct.

richardgobeli commented 10 months ago

OK, I'll check tomorrow. the sum symbol should be raised a bit to center it. image

richardgobeli commented 10 months ago

The color does work now. The sum symbol needs to be centered better. image image