~ajstarks

Recent activity

Theme: update default window top bar colors and text 6 months ago

From Anthony Starks to ~eliasnaur/gio-patches

References: https://todo.sr.ht/~eliasnaur/gio/500

diff --git a/widget/material/theme.go b/widget/material/theme.go
index 3da7f4e7..0ed497a6 100644
--- a/widget/material/theme.go
+++ b/widget/material/theme.go
@@ -58,8 +58,8 @@ func NewTheme() *Theme {
        t.Palette = Palette{
                Fg:         rgb(0x000000),
                Bg:         rgb(0xffffff),
-               ContrastBg: rgb(0x3f51b5),
-               ContrastFg: rgb(0xffffff),
+               ContrastBg: rgb(0xdfdbd8),
+               ContrastFg: rgb(0x000000),

Re: Conversion between Dp and Px, and float type 3 years ago

From Anthony Starks to ~eliasnaur/gio

I'm wondering if the use of device-independent percentage-based
coordinate system (as is used in giocanvas) would be useful.


On Wed, Nov 10, 2021 at 1:04 PM Christophe Meessen
<christophe@meessen.net> wrote:
>
> Hello Chris
>
> I agree that the low level interface for raw op.Ops should stay in Px
> unit and float32. I’m only concerned about the end user API, the one
> that must be the most simple, efficient and stable.
>
> You asked me what I would suggest in place of unit.Value. I suggest to

Re: Request for comments for a op.Save/Load replacement 3 years ago

From Anthony Starks to ~eliasnaur/gio

Now that the changes have been made, here is a quick report on
updating giocanvas with the new API.   Originally, giocanvas has
several functions that perform transforms like this:

// AbsTranslate moves current location by (x,y)
func (c *Canvas) AbsTranslate(x, y float32) op.StateOp {
    ops := c.Context.Ops
    op.InvalidateOp{}.Add(ops)
    stack := op.Save(ops)
    tr := f32.Affine2D{}
    tr = tr.Offset(f32.Pt(x, y))
    op.Affine(tr).Add(ops)
    return stack
}

Re: [PATCH v3] op/clip: implement arc path 4 years ago

From Anthony Starks to ~eliasnaur/gio-patches

Re: SVG API -- I'm not a fan either, but it has the advantage of familiarity.
Re: Arcs like the existing Loader (older version), see:

https://github.com/ajstarks/giocanvas/blob/74de31426979ddf304fcd6701c5a057d2a0b13b7/abs.go#L246-L284

Re: Use cases for arc: (both circular and elliptical)

1) making a stroked arc
2) making a "wedge" shape (as seen in pie charts)

the elements are for making the arc:

1) center point
2) width, height

giocanvas/chart 4 years ago

From Anthony Starks to ~eliasnaur/gio

The giocanvas package now includes a charting package,
giocanvas/chart.  It supports line, area, scatter, and bar charts,
with titles and configurable axes.

The package reads data into a ChartBox structure (name, value pairs
(tab-separated) with metadata).

type ChartBox struct {
    Title                    string
    Data                     []NameValue
    Color                    color.RGBA
    Top, Bottom, Left, Right float64
    Minvalue, Maxvalue       float64
    Zerobased                bool

Re: op/path: draw-arc ? 4 years ago

From Anthony Starks to ~eliasnaur/gio

Note that giocanvas has buggy, incomplete version Arc code (see the
method AbsArc).  Fixes welcomed.

Re: Canvas 2D API Notes 4 years ago

From Anthony Starks to ~eliasnaur/gio

Thanks for the kind words.   FYI, the code that made the screen in the
README is at https://github.com/ajstarks/giocanvas/blob/master/play/main.go

On Thu, Jun 4, 2020 at 6:48 PM <dolanor@evereska.org> wrote:
>
> > After two weeks, here is the progress to date:
> > https://github.com/ajstarks/giocanvas
>
> I haven't looked at the API yet. But just the result in the README makes me wanna play with it already.
>
> Great job!
>
> I have worked on an SVG project for 3 months end of 2019, but it was on C#. So, this tickles my curiosity!

Re: Contribution?: General transforms (Affine 2D) 4 years ago

From Anthony Starks to ~eliasnaur/gio

+1 on this proposal.


On Thu, Jun 4, 2020 at 3:07 PM Viktor Ogeman <viktor.ogeman@gmail.com> wrote:
>
> Hi,
>
> I am in need of transforms that include scaling, and find a TODO in the src
> showing that this is on the table. If there is interest I would be
> willing to try
> to send a first patch implementing this.
> Before I begin though it would be good to get clarification on a few items:
>
> 1. Still interest in getting this implemented?

Re: Canvas 2D API Notes 4 years ago

From Anthony Starks to ~eliasnaur/gio

After two weeks, here is the progress to date:
https://github.com/ajstarks/giocanvas

Canvas 2D API Notes 4 years ago

From Anthony Starks to ~eliasnaur/gio

As discussed in the May community call, here are my notes on a general
canvas-like 2D API

# Notes on a general 2D API

## Introduction and Motivation

The principle is to keep the number of methods small and consistent,
using a common set of arguments for
location (x, y), and dimensions (w, h).

## Coordinate System

The coordinate system follows the traditional convention you learned in school: