how can I fix font size to image?
Answered
Hi,
I have created this rectangle, and I want font size to change in order to always fit to the rectangle.
Rectangle size is always the same, but...
1) when I zoom out, rectangle is shown smaller, but the text remains big, so now it's too big for the rectangle
2) when I zoom in, for the same reason, text turns out to be too small
3) as I click on the buttons and number value changes, either because the number becomes negative or the number has more than one digit, it eventually becomes too big for the rectangle.
I put a box with a percentage, in case I want to adjust size manually, but I didn't get how to make font size "read" this box.
Can anybody help with this? Thanks in advance
Files:
ascensor.ggb
You can do it like this: https://www.geogebra.org/m/RvCFzYvu
Mike, esto te va a encantar
https://www.geogebra.org/m/nraudgpw
based on mathmagic's solution a slightly modified version (and adapted to your requirements).
If this still confuses you (which is very likely): ask good, specific questions (please not: how does it all work)
double, deleted
here something similar (minimalistic)
1º cuando algo funciona, funciona. Si falla puntualmente se borra el objeto y se vuelve a construir. Seguramente el texto era de otro tipo de posicionamiento y se guardó con un desplazamiento tipo del que se usa para colocar los rótulos alrededor del objeto
2º no es bueno limitar los valores de los deslizadores que se calculan numéricamente pues necesitan cierto margen para aproximarse; en algunos pasos se acercan y en otros se alejan. Por eso he cambiado el script
3º he puesto el rótulo sobre y no encima del segmento, pero si es necesario ajustar algo el desfase puedes sumar a C un poquito de desplazamiento para recolocarlo; no mucho
Comments have been locked on this page!