microsoft / pxt-microbit

A Blocks / JavaScript code editor for the micro:bit built on Microsoft MakeCode
https://makecode.microbit.org
Other
722 stars 594 forks source link

Spanish language text cut off of blocks on zoom #2096

Closed JacobBovee closed 4 years ago

JacobBovee commented 5 years ago

Describe the bug When zooming on blocks in Spanish the text seems to be too large and gets cut off.

To Reproduce Steps to reproduce the behavior:

  1. Change language to Spanish
  2. Pinch and zoom in to blocks

Expected behavior Blocks should be recomputed based on the size of the text

Screenshots

Spanish: image

English: image

Desktop (please complete the following information):

abchatra commented 5 years ago

I believe this is a translation issue. Must be easy to fix. Notice the A is at the end instead of middle.

abchatra commented 5 years ago

@ganicke you know how to fix this?

ganicke commented 5 years ago

No puedo repro en Chromo de Windows 10...

image

ganicke commented 5 years ago

Also, scrape the event function from core/input.cpp, replace the block text with the Spanish from Crowdin, and throw it into playground -

enum Button {
    A = 0,
    B = 1,
    //% block="A+B"
    AB = 2
};
/**
 * Events are functions that take a function (lambda) as the last argument
 */
//% color="#AA278D"
namespace testme {
    /**
     * Do something when a button (A, B or both A+B) is pushed down and released again.
     * @param button the button that needs to be pressed
     * @param body code to run when event is raised
     */
    //% help=input/on-button-pressed weight=85 blockGap=16
    //% blockId=device_button_event block="al presionarse el botón|%NAME|"
    //% parts="buttonpair"
    export function onButtonPressed( button: Button, handler: () => void) {
    }
}
JacobBovee commented 5 years ago

Zooming in is fine in playground however zooming out far enough gives you a little trouble with the text overflowing.

image

ganicke commented 5 years ago

Hmm, try defining a block with a long English string and see if it behaves similarly. I don't have touch screen at the moment to try. I can't get it to squish with the zoom controls. If it happens with a English string too then it's a blocks render problem.

abchatra commented 5 years ago

Thanks @ganicke We will look into this.

JacobBovee commented 5 years ago

@ganicke I also found it to be cutoff with long english strings. image

The zoom on this chrome os laptop is very slow as well which may be part of the issue if it can't be reproduced.

ganicke commented 5 years ago

Is this a Blockly thing maybe?

jwunderl commented 5 years ago

Looks like a blocky thing, showed up in an arcade tutorial with a long extension block:

Screen Shot 2019-06-18 at 11 02 40 AM

abchatra commented 4 years ago

This is text bleeding issue in blockly. Take a look if this fixed in latest.

shakao commented 4 years ago

image

Tested zooming in and out with long strings and this doesn't repro for me with latest blockly--but I don't know if this was a Chromebook-only bug? I also can't repro on live microbit (Chrome, Windows 10).

abchatra commented 4 years ago

Fixed it was everywhere int he past.