ComicScreenGrid class

A screen of dots laid on whole device pixels, so a tile repeats exactly and there's no moiré at any scale.

pitch is the distance between dots in a row and radius a dot's size, in logical pixels. Staggered rows sit half a pitch apart in x. The pitch is rounded to whole device pixels (even ones when staggered, so the half-step is whole too), and the radius moves with it so a tone stays the tone. dpr is MediaQuery.devicePixelRatioOf(context).

Constructors

ComicScreenGrid(double pitch, double radius, double dpr, {bool staggered = true, double rowFactor = .5})
Creates a ComicScreenGrid.

Properties

devicePitch → int
devicePitch: the horizontal dot period in physical pixels. deviceRow: the vertical dot period in physical pixels.
final
deviceRow → int
devicePitch: the horizontal dot period in physical pixels. deviceRow: the vertical dot period in physical pixels.
final
dpr → double
dpr: the physical pixels per logical pixel. radius: the radius in logical pixels.
final
hashCode → int
The hash code for this object.
no setterinherited
pitch → double
The dot period in logical pixels after physical-pixel snapping.
no setter
radius → double
dpr: the physical pixels per logical pixel. radius: the radius in logical pixels.
final
row → double
The row period in logical pixels after physical-pixel snapping.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
staggered → bool
Offsets alternating rows of dots by half a period.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
paint(Canvas canvas, Rect rect, Color color) → void
Paints this screen's dots in rect, clipped to it. The dots go down in device pixels so that every one of them lands on the same part of a pixel: no drift, no moire.
points(Size size) → Float32List
Dot centres inside size, x and y pairs, in logical pixels.
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited