Skip to content

TFPImageCanvas does not support filling of ellipses by pattern brush

Summary

TFPImageCanvas fails to fill an ellipse by a pattern brush. The low-level function FillEllipsePattern() in unit ellipses is empty.

System Information

  • Operating system: Windows 11
  • Processor architecture: x86-64
  • Compiler version: 3.2.2 or trunk
  • Device: Computer

Steps to reproduce, example project

The attached example project draws several ellipses on a TFPImageCanvas and fills them with various brushes.

hatch-ellipses.zip

What is the current bug behavior?

This is the output image of the example project with the current code.

The first row of ellipses uses the pre-defined brushes - they work fine. In the second row, Brush.Style is set to bsPattern to fill the circles with custom bit patterns. All these ellipses are not filled.

HatchEllipse_Test_current

What is the expected (correct) behavior?

This is the output of the example project after application of the patch below.

HatchEllipse_Test_new

Fix

The code to fill ellipses by various brushes is contained in unit ellipses, and the code executed when Brush.Style is bsPattern is in procedure FillEllipsePattern() which is empty.

Taking the other filling routines as a guide I completed the missing code in FillEllipsePattern(), and with that the above correct image could be created.

hatch_ellipses.diff

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information