Giter Club home page Giter Club logo

Comments (4)

AndyObtiva avatar AndyObtiva commented on August 16, 2024

I just wanted to note that I solved my need for geometric algorithms by implementing all of them in a brand new library written in pure Ruby called Perfect Shape.

That said, it is still useful to provide such algorithms in C libui, especially to software engineers from other programming languages who do not have an equivalent of Perfect Shape in their programming language of choice (or they could otherwise switch to Ruby and use Glimmer DSL for LibUI I suppose).

Cheers!

from libui.

AndyObtiva avatar AndyObtiva commented on August 16, 2024

I already started integrating the geometric algorithm library Perfect Shape into Glimmer DSL for LibUI.

And, it just occurred to me; there is a scenario that Perfect Shape cannot address, which is checking if a point is contained within a drawn Text on Area (though I could approximate it if I knew the font in advance). That requires font-dependent calculations, which libui does not currently offer.

SWT provides something called the textExtent that enables software engineers to check if a point is within the extent (size) of drawn Text (varying depending on configured font). It would be great if the libui C library could provide something similar to begin. But, it would be great if it can go even further than that and let software engineers know if a point is contained within the exact area occupied by the text Glyphs (e.g. point is within all the segments that make up the letter T). That way, I could implement a use-case (mentioned to me just yesterday by a user) of being able to detect if the user is pointing with the mouse at a specific drawn word of text and then change its color or highlight another related word in response.

It would be helpful to include such features in libui for better usage by software engineers and better service for customer needs.

Cheers!

from libui.

cody271 avatar cody271 commented on August 16, 2024

That requires font-dependent calculations, which libui does not currently offer.

SWT provides something called the textExtent that enables software engineers to check if a point is within the extent (size) of drawn Text (varying depending on configured font). It would be great if the libui C library could provide something similar to begin.

This is already implemented with uiDrawTextLayoutExtents(), which does take the specified layout font into account.

from libui.

AndyObtiva avatar AndyObtiva commented on August 16, 2024

Ahh. Thanks for pointing that out.

To be honest, I thought extent support existed, but I quickly checked the Golang LibUI docs and didn’t find it there, so then I mistakenly concluded I was wrong about extent support existing in LibUI and commented here.

from libui.

Related Issues (20)

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.