Menu

Scaling the Project Logo in GanttProject PDF and PNG Exports
📰

Scaling the Project Logo in GanttProject PDF and PNG Exports

DEV Community: kotlin·Robert Markovski·about 5 hours ago
#d00xhDkI
#devtokotlin#devto#dev#merged#maintainer
Reading 0:00
15s threshold

A maintainer-filed bug, a fix in Kotlin and Java, and a merge about four hours later.

Short answer

In GanttProject, a tall custom logo was drawn at full size in PDF exports, which made the timeline taller instead of scaling the logo down as the app window does. The fix caps the logo at the default logo height, computes a matching width, and has both the PDF and raster exporters draw the logo into that box. It was merged as PR #2824 for issue #2613 .

The problem

GanttProject is an open-source desktop project scheduling app. Issue #2613, filed by a maintainer, described it: choose a logo taller than about 300 px, export to PDF, and "the logo is not scaled down. Instead, the timeline height grows."

The fix

ChartDimensions now derives the logo box from the source image:

val logoHeight : Int = if ( logoSourceWidth <= 0 || logoSourceHeight <= 0 ) 0 else min ( logoSourceHeight , UIFacade . DEFAULT_LOGO . iconHeight ) val logoWidth : Int = if ( logoHeight == 0 ) 0 else ( logoSourceWidth .…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.