Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > de.comp.lang.javascript > #4925

Re: "Optische" Zeichenhöhe berechnen

From Christian Zimmermann <ch.zim@web.de>
Newsgroups de.comp.lang.javascript
Subject Re: "Optische" Zeichenhöhe berechnen
Date 2017-11-20 10:31 +0100
Organization albasani.net
Message-ID <ouu7d2$lv7$1@news.albasani.net> (permalink)
References <ouk8ir$ed9$1@news.albasani.net> <ouu45o$v5o$1@news.albasani.net>

Show all headers | View raw


Hier sollte canvas.height im letzten Parameter ersetzt werden durch 1.
Außerdem ist das i unnötig, da direkt mit txtMet.adjust gerechnet werden
kann.

>   img = ctx.getImageData(0, canvas.height - 1, canvas.width, canvas.height);
>   i=0;
>   while (!isRowEmpty(img)) {
>         i++;
>         ctx.clearRect(0, 0, canvas.width, canvas.height);
>         ctx.fillText(text, 0, canvas.height - i);
>         img = ctx.getImageData(0, canvas.height - 1, canvas.width,
> canvas.height);
>   }
>   if (i > 0) txtMet.adjust = i - 1;

*korrigierter Abschnitt:*

img = ctx.getImageData(0, canvas.height - 1, canvas.width, 1);
while (!isRowEmpty(img)) {
        txtMet.adjust++;
        ctx.clearRect(0, 0, canvas.width, canvas.height);
        ctx.fillText(text, 0, canvas.height - txtMet.adjust);
        img = ctx.getImageData(0, canvas.height - 1, canvas.width, 1);
}
if (txtMet.adjust > 0) txtMet.adjust -= 1;

Back to de.comp.lang.javascript | Previous | NextPrevious in thread | Find similar


Thread

"Optische" Zeichenhöhe berechnen Christian Zimmermann <ch.zim@web.de> - 2017-11-16 15:50 +0100
  Re: "Optische" Zeichenhöhe berechnen Arno Welzel <usenet@arnowelzel.de> - 2017-11-16 19:50 +0100
    Re: "Optische" Zeichenhöhe berechnen Christian Zimmermann <ch.zim@web.de> - 2017-11-16 20:07 +0100
      Re: "Optische" Zeichenhöhe berechnen "Peter J. Holzer" <hjp-usenet3@hjp.at> - 2017-11-16 23:33 +0100
        Re: "Optische" Zeichenhöhe berechnen Christian Zimmermann <ch.zim@web.de> - 2017-11-17 00:00 +0100
          Re: "Optische" Zeichenhöhe berechnen Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2017-11-17 02:35 +0100
            Re: "Optische" Zeichenhöhe berechnen Christian Zimmermann <ch.zim@web.de> - 2017-11-17 08:06 +0100
              Re: "Optische" Zeichenhöhe berechnen Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2017-11-17 14:00 +0100
                Re: "Optische" Zeichenhöhe berechnen Christian Zimmermann <ch.zim@web.de> - 2017-11-20 09:54 +0100
      Re: "Optische" Zeichenhöhe berechnen Arno Welzel <usenet@arnowelzel.de> - 2017-11-18 19:52 +0100
        Re: "Optische" Zeichenhöhe berechnen Christian Zimmermann <ch.zim@web.de> - 2017-11-20 09:46 +0100
  Re: "Optische" Zeichenhöhe berechnen Christian Zimmermann <ch.zim@web.de> - 2017-11-20 09:36 +0100
    Re: "Optische" Zeichenhöhe berechnen Christian Zimmermann <ch.zim@web.de> - 2017-11-20 10:31 +0100

csiph-web