16 Commits

Author SHA1 Message Date
Nyall Dawson
e81fcd0b09 Start on QgsLabelPointSettings class 2024-05-23 17:20:30 +10:00
Nyall Dawson
2b2975817d Promote some label flags to enum class, move to Qgis 2023-03-31 13:17:25 +10:00
Nyall Dawson
f9c3da1e06 Move unit enums to Qgis, promote to enum class 2023-02-19 13:29:06 +10:00
Nyall Dawson
94f198b36b Default to a "Follow placement" mode for the text anchor point, which
means when the line anchor is < 25% then it will be matched to the
start of the text, when the line anchor is > 75% it will be matched
to the end of the text, otherwise match to center of text
2022-03-15 16:31:45 +10:00
Nyall Dawson
3924437947 Use Q_ENUM for enums 2022-03-15 16:31:45 +10:00
Nyall Dawson
f2e338259a [feature][labeling] Expose control of what part of text (start,
middle or end) of line labels corresponds to the anchor position

Previously labels would always be centered over the anchor position
of lines (unless it was a curved label, in which case it was the
start of the lable!) This is limiting (and inconsistent) for some
placements, where it is preferable to e.g. line up the end
of the label text with a specific point on the line
2022-03-15 16:31:45 +10:00
Nyall Dawson
7126faf27c [feature][labelling] Add an option to control how line features are
clipped before their anchor points are calculated

The previous behavior was to always use only the visible part
of the line when calculating the anchor point for labels. Now,
users have the option to choose "Use Entire Line" when setting
the label anchor point for lines, so that the entire line
feature is considered when calculating the point to place
the label instead of just the visible part of the line.

Sponsored by Stadt Zürich
2021-04-09 13:29:08 +10:00
Denis Rouzaud
ba8a445850 run sipify 2021-03-22 21:13:52 +01:00
Nyall Dawson
f62c6d5d56 [feature][labeling] Expose option to allow users to control whether
anchor point for line labels is a hint or a strict requirement

Strict: Labels are placed exactly on the label anchor only, and no
other fallback placements are permitted.

Hint: The label anchor is treated as a hint for the preferred label
placement, but other placements close to the anchor point are permitted.
2020-08-21 09:48:47 +10:00
Nyall Dawson
b14bb32104 [labeling] Add api to set line anchor point for labels, which represents
the percentage along line features at which labels for that feature
should gravitate toward
2020-08-18 11:09:18 +10:00
Nyall Dawson
ff9f525893 Fix see also links 2020-08-17 11:12:33 +10:00
Nyall Dawson
844e9a3aac Move label overrun settings to QgsLabelLineSettings 2020-08-17 11:12:33 +10:00
Nyall Dawson
b31d315a52 Move another line label related setting and enum to QgsLabelLineSettings 2020-08-17 11:12:33 +10:00
Nyall Dawson
5dfbfaa89e Move some more line label related settings to QgsLabelLineSettings 2020-08-17 11:12:33 +10:00
Nyall Dawson
d93d881192 Move merge line settings to QgsLabelLineSettings 2020-08-17 11:12:33 +10:00
Nyall Dawson
23848e0e89 Start cleaning up label line settings, by moving them from the
QgsPalLayerSettings mega class to a dedicated QgsLabelLineSettings
class
2020-08-17 11:12:33 +10:00