[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [pygame] `pygame.draw.line(...)` `width`
- To: "pygame-users@xxxxxxxx" <pygame-users@xxxxxxxx>
- Subject: Re: [pygame] `pygame.draw.line(...)` `width`
- From: mar77i@xxxxxxxxxxxxx
- Date: Sat, 28 Apr 2018 16:41:06 -0400
- Delivered-to: archiver@xxxxxxxx
- Delivered-to: pygame-users-outgoing@xxxxxxxx
- Delivered-to: pygame-users@xxxxxxxx
- Delivery-date: Sat, 28 Apr 2018 16:48:59 -0400
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.ch; s=default; t=1524948070; bh=pzxCpPu7GyI8wLOQPeEFH4aiCdh7Llqt/xjagsXKh0o=; h=Date:To:From:Reply-To:Subject:In-Reply-To:References:Feedback-ID: From; b=voq1bIBTlcyb0B5LXgTTmhOqERRs+g0n3w6Wl51LKWGKM6yY0BUdFXi+pvGekDOC2 tjDO5PDFFJBaRLTkWNychC9Zwf0UpptsudoS+jDk0dGYthlphv19HavqBztJt59zZF WkN4TX5WfdzdDRtYZoF5MgrroDk75rHuXhesVt1I=
- Feedback-id: ASftZ_2yqXkAhaWCcGcePRCCJC5RL2OyJPYdqJfEE0MXGTlrNYumly9FcPMehUmvjCIOT6upnH_zDslWb9TCxA==:Ext:ProtonMail
- In-reply-to: <CAG4NV=tOYmQYebhm-02qcW-S+8rjMTT9cb06MMRzBxk4d-mrQg@mail.gmail.com>
- References: <CAG4NV=tOYmQYebhm-02qcW-S+8rjMTT9cb06MMRzBxk4d-mrQg@mail.gmail.com>
- Reply-to: pygame-users@xxxxxxxx
- Sender: owner-pygame-users@xxxxxxxx
‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
> I don't remember noticing this behavior before, but it seems that the lines' widths are chosen so that the ends, which are also axis-aligned, are the given width. Thus, the lines can be up to about 29% thinner than one would expect.
Pygame does not have a kind of brush for this but instead draws many single lines closely next to each other. Therefore, in some edge cases it can even happen that your line has few pixel "holes" in them.
I think that's good enough for practical use in many cases, but that's because it's actually simpler this way - and faster than "more correct" approaches. Whenever I actually need a wide line "done right", I'd instead go outline the area and fill it or something.
cheers!
mar77i
Sent with ProtonMail Secure Email.