shoes / shoes3

a tiny graphical app kit for ruby
http://walkabout.mvmanila.com
Other
181 stars 19 forks source link

undocumented dash style/method #244

Closed passenger94 closed 7 years ago

passenger94 commented 8 years ago

!!!

Shoes.app do
    stack left: 50, top: 50, width: 400, height: 400 do
        border brown, strokewidth: 5, dash: :onedot

        line 0,200,400,200, dash: :onedot, stroke: green, strokewidth: 3
        oval 200,150,150,50, center: true, fill: orange, dash: :onedot, stroke: red, strokewidth: 3
        shape left: 200, top: 250, fill: orange, dash: :onedot, stroke: red, strokewidth: 3 do
            move_to -175,0
            line_to 125, -30; line_to 10,50; line_to -175,0
        end
    end
end

dashes

Probably WIP as there is only one variant :onedot if i don't miss something ...

ccoupe commented 8 years ago

It's still true -- Nobody knows Shoes~

dredknight commented 7 years ago

The manual for this one will be pretty short as it only supports one option :onedot. Is there a way to see what options are available for styles? for example

para "Shoes", align: "center" 

align can also be "left" and "right" but how do I find this (except from the manual)? Is there a command to see all available options for shoes elements styles and options?

One funny thing is that besides the shapes above :onedot is also available for arrow. The difference is almost unnoticeable. Probably because the arrow length/thick ratio is too small. Unless there is a way to set arrow length independently of the width, :onedot is useless for that element.

P.S. My bad it works for arrow and rectangle. You just need to set the fill to a colour different than black.

Shoes.app do
   arrow(40, 40, 60)
   arrow(40, 120, 60,dash: :onedot, fill: green)
end
IanTrudel commented 7 years ago

The manual for this one will be pretty short as it only supports one option :onedot.

:onedot and :nodot are supported according to the C source code.

Is there a way to see what options are available for styles? align can also be "left" and "right" but how do I find this (except from the manual)? Is there a command to see all available options for shoes elements styles and options?

This is the purpose of the manual, amongst other things.

Styles are defined at C level without Ruby/Shoes counterpart. Shoes has no way to know about styles. They are literally parsed as you can see here: https://github.com/Shoes3/shoes3/blob/master/shoes/ruby.c#L2776

One funny thing is that besides the shapes above :onedot is also available for arrow. The difference is almost unnoticeable.

This is a good catch. One would wonder why arrow cannot be of different length. Perhaps opening an issue about arrow length would be advisable.

dredknight commented 7 years ago

Pushed the final version of Dash to the master. Let me know if anything should be changed. Otherwise we can close this one.

dredknight commented 7 years ago

Sorry for the formatting errors :(

IanTrudel commented 7 years ago

No worries, @dredknight! Your help is very much appreciated. :)

dredknight commented 7 years ago

:)