Page 1 of 1

Wrong size after scaling a vector brush

Posted: Tue Jul 21, 2026 4:04 pm
by jPV
I found a situation where vector brush scaling produces one pixel too wide brush. The rightmost pixel column becomes black. I'm not sure if it's related to the pdf plugin and specific files or can it be reproduced more widely. In any case it only happens when the original brush is a vector brush, and it doesn't happen if I rasterize the brush first. It also doesn't happen with all sizes, but quite random numbers.

It is reproducible at least on MorphOS and Windows. And when trying with older Hollywood versions... HW10 is the same as 11, but on HW9.1 the first test gets smaller result (761 vs 762) and the latter is correct (763).

I found it when dealing with this example file.

Here's some code to reproduce it with the previous file:

Code: Select all

@REQUIRE "pdf"
@DISPLAY {Width=800, Height=600, Color=#YELLOW}

f$ = "Amiga_1_AmigaDOS.pdf"

pdf.OpenDocument(1, f$)
pdf.GetBrush(1, 1, 1)
SetFont(#SANS, 40)
SetFontStyle(#BORDER)

; This works OK
ScaleBrush(1, 762, #KEEPASPRAT)
DisplayBrush(1, 0, 0)
NPrint("Width after scaling to 762:", GetAttribute(#BRUSH, 1, #ATTRWIDTH))
NPrint("Click LMB...")

WaitLeftMouse()

; This produces a brush with width 764 instead of 763, there's a black right border on it too
ScaleBrush(1, 763, #KEEPASPRAT)
DisplayBrush(1, 0, 0)
NPrint("Width after scaling to 763:", GetAttribute(#BRUSH, 1, #ATTRWIDTH))

FreeBrush(1)
pdf.CloseDocument(1)
WaitLeftMouse()