Git Product home page Git Product logo

Comments (5)

awocrf avatar awocrf commented on June 24, 2024

When I add the lines below to the end of UG_FillRoundFrame function it fixes that.

UG_DrawArc(x1+r, y1+r, r, 0x0C, c); UG_DrawArc(x2-r, y1+r, r, 0x03, c); UG_DrawArc(x1+r, y2-r, r, 0x30, c); UG_DrawArc(x2-r, y2-r, r, 0xC0, c);

I pulled them out of UG_DrawRoundFrame.

from st7789-stm32-ugui.

deividAlfa avatar deividAlfa commented on June 24, 2024

Maybe... ?

void UG_FillRoundFrame( UG_S16 x1, UG_S16 y1, UG_S16 x2, UG_S16 y2, UG_S16 r, UG_COLOR c )
{
   UG_S16  x,y,xd;

   if ( x2 < x1 )
     swap(x1,x2);
   if ( y2 < y1 )
     swap(y1,y2);

   if ( r<=0 ) return;

   xd = 3 - (r << 1);
   x = 0;
   y = r;

   UG_FillFrame(x1 + r, y1, x2 - r, y2, c);

   while ( x <= y )
   {
     if( y > 0 )
     {
        UG_DrawLine(x2 + x - r, y1 - y + r, x2+ x - r, y + y2 - r, c);
        UG_DrawLine(x1 - x + r, y1 - y + r, x1- x + r, y + y2 - r, c);
     }
     if( x > 0 )
     {
        UG_DrawLine(x1 - y + r, y1 - x + r, x1 - y + r, x + y2 - r, c);
        UG_DrawLine(x2 + y - r, y1 - x + r, x2 + y - r, x + y2 - r, c);
     }
     if ( xd < 0 )
     {
        xd += (x << 2) + 6;
     }
     else
     {
        xd += ((x - y) << 2) + 10;
        y--;
     }
     x++;
   }
  UG_DrawRoundFrame(x1, y1, x2, y2, r, c );
}

from st7789-stm32-ugui.

awocrf avatar awocrf commented on June 24, 2024

This one works too but I don't know if it's faster or not

from st7789-stm32-ugui.

deividAlfa avatar deividAlfa commented on June 24, 2024

It should perform pretty much the same.
Please note I'm not the author of uGUI neither I'm developing this fork anymore.
My main contribution was adding a new font structure and UTF-8 support.
If this works for you consider making a pull request.
Thanks!

from st7789-stm32-ugui.

awocrf avatar awocrf commented on June 24, 2024

Yeah, this works for me but I have no idea how to create a pull request with this patch since I've never used this feature before

from st7789-stm32-ugui.

Related Issues (8)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.