-
Notifications
You must be signed in to change notification settings - Fork 335
Highlighting selection bounds on rulers #1723
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Highlighting selection bounds on rulers #1723
Conversation
Pinta.Gui.Widgets/Widgets/Ruler.cs
Outdated
| if (selection_start < selection_end) { | ||
|
|
||
| // Convert selection coordinates to ruler widget coordinates | ||
| double p1 = (selection_start - Lower) * (settings.EffectiveSize.Width / (Upper - Lower)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe there should be a helper function for this conversion, since it also happens for the marker position?
Pinta.Gui.Widgets/Widgets/Ruler.cs
Outdated
| double p1 = (selection_start - Lower) * (settings.EffectiveSize.Width / (Upper - Lower)); | ||
| double p2 = (selection_end - Lower) * (settings.EffectiveSize.Width / (Upper - Lower)); | ||
|
|
||
| cr.SetSourceRgba (0.5, 0.7, 1.0, 0.5); // Semi-transparent blue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does it look with the same color that's used for selections on the canvas?
| Gdk.RGBA fillColor = new () { Red = 0.7f, Green = 0.8f, Blue = 0.9f, Alpha = 0.2f }; |
|
You are right @cameronwhite, although the selection bounds are a As for the selection color, I think the one I chose is more similar to Paint.NET's. Not that Pinta has to copy its features, but it's worth noting for context. The color you suggested is on commit bccde34 and it looks like this: Pinta_5k3ds041x6.mp4On a different, but related note, looking through the code, I found that the public readonly record struct RectangleD (
double X,
double Y,
double Width,
double Height)
{
// ...
public readonly RectangleI ToInt ()
=> new (
(int) Math.Floor (X),
(int) Math.Floor (Y),
(int) Math.Ceiling (Width),
(int) Math.Ceiling (Height));
// ...
}I think this could be unclear or misleading. Maybe we should add an |
|
Thanks! The original color looks better, but maybe we can make it a more subtle (e.g. a bit more transparent perhaps?) We could actually use https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/method.StyleManager.get_accent_color_rgba.html to get the exact same color, but I'm not sure if we want that since the accent color can vary based on system settings (https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/css-variables.html#accent-colors), and I think this should stay blue to match the selection. Using the same blue color could be worth trying though
|
|
@cameronwhite now the color is more similar to Adwaita's accent color. I normalized the channels to a range of 0-1, rounded it to two decimal places, and set an alpha of 0.25.
|
|
Thanks! That colour looks good to me 👍 |







Addresses #1094
For multiple selections I'd like to highlight the different bounds separately, but I think this will do for now.
pinta_rule_highlighting.mp4