Skip to content
GitLab
    • GitLab: the DevOps platform
    • Explore GitLab
    • Install GitLab
    • How GitLab compares
    • Get started
    • GitLab docs
    • GitLab Learn
  • Pricing
  • Talk to an expert
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
    • Switch to GitLab Next
    Projects Groups Snippets
  • Sign up now
  • Login
  • Sign in / Register
  • Lazarus Lazarus
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 2,112
    • Issues 2,112
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 14
    • Merge requests 14
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • External wiki
    • External wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • FPC
  • LazarusLazarus
  • LazarusLazarus
  • Issues
  • #38852
Closed
Open
Issue created May 04, 2021 by FPC Admin account@fpc_adminOwner

TGraphicControl draws Polygon relative to owner in gtk2 when Pen.style = psClear

Original Reporter info from Mantis: wp @wpam
  • Reporter name:

Description:

A control derived from TGraphicControl is not drawn correctly in gtk2 when a particular overload of the Polygon method is called with Pen.Style = psClear.
See forum discussion https://forum.lazarus.freepascal.org/index.php/topic,54329.msg404509.html#msg404509.

Steps to reproduce:

The attached project implements a simple descendant of TGraphicControl which draws two red rectangles inside its interior. The first one (left) is drawn by

Canvas.Polygon([Point(20, 20), Point(80, 20), Point(80, 80), Point(20, 80)]);

the second one (right) is drawn by

  var
    P: Array[0..3] of TPoint;
  ...
    P[0] := Point(80, 20);
    P[1] := Point(140, 20);
    P[2] := Point(140, 80);
    P[3] := Point(80, 80);
    Canvas.Polygon(P, 4); 

In the demo program the control is right-bottom-anchored to its containing form. When the form size is changed the control thus follows the right/bottom corner of the form and, of course, the inner rectangles are expected to follow the control. But only the second rectangle does this, the first rectangle remains stationary on the form.

It turned out that the state of the Pen.Style is critical for this issue. The error occurs when Pen.Style = psClear when the Polygon is drawn. Swithching Pen.Style to psSolid (by UNDEFining the define SHOW_BUG) also the first rectangle is painted as expected.

Additional information:

The error occurs only on gtk2 widgetset. gtk3, qt5, win32 and cocoa are behaving correctly.

Mantis conversion info:

  • Mantis ID: 38852
  • Fixed in revision: 65088 (#426f9a53)
  • Monitored by: » AntonK (Anton Kavalenka)
Assignee
Assign to
Time tracking