Skip to content

Bitmaptools.blit raises Value Error inappropriately #8822

@furbrain

Description

@furbrain

CircuitPython version

dafruit CircuitPython 9.0.0-alpha.6-19-g99b19a5860-dirty on 2024-01-22; SAP6 (including Seeed XIAO nRF52840 Sense with nRF52840

Code/REPL

# create a source bitmap of size (100,100)
# create a destination bitmap of size (10,10)
bitmaptools.blit(dest, source, 0,0, 30,30,35,35)

Behavior

this raises a value error stating X1 should be in the range 0..9

Description

No response

Additional information

This is caused by an error in bitmaptools.blit where x1..y2 are compared against the width and height of the destination
bitmap, instead of the source bitmap. This particularly causes problems when drawing text to small screens from the terminalio font (which comes from quite a large bitmap)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions