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


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

Re: "Optische" Zeichenhöhe berechnen

Path csiph.com!weretis.net!feeder4.news.weretis.net!news.albasani.net!.POSTED!not-for-mail
From Christian Zimmermann <ch.zim@web.de>
Newsgroups de.comp.lang.javascript
Subject Re: "Optische" Zeichenhöhe berechnen
Date Mon, 20 Nov 2017 10:31:18 +0100
Organization albasani.net
Lines 25
Message-ID <ouu7d2$lv7$1@news.albasani.net> (permalink)
References <ouk8ir$ed9$1@news.albasani.net> <ouu45o$v5o$1@news.albasani.net>
Mime-Version 1.0
Content-Type text/plain; charset=utf-8
Content-Transfer-Encoding 8bit
X-Trace news.albasani.net zsk1fYEBZMQnrDNa5h8I0Ll+74GNUpZi1QiUj1XKXEk7sakT8m6Z7YlS0Z1FfCLg37g/CNonMawjzA/ph4FP7w==
NNTP-Posting-Date Mon, 20 Nov 2017 09:31:14 +0000 (UTC)
Injection-Info news.albasani.net; logging-data="pbN8KOaW749XKjsW++RJ1M0NFFJHAaLG6Z4wQ7NqyIJgSHgOVM6ANYyEZ78w42JOYHZ4Qm5BjbzQB3sT5BAFjBKAsIPq0jLDI9NyWUKfBph7MaMeuRQlKvNERL+O/djO"; mail-complaints-to="abuse@albasani.net"
User-Agent Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0
In-Reply-To <ouu45o$v5o$1@news.albasani.net>
Cancel-Lock sha1:sSaiKpgwC+AslSa/4ovpqNrfk2s=
Xref csiph.com de.comp.lang.javascript:4925

Show key headers only | 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