Subject | Hash | Author | Date (UTC) |
---|---|---|---|
Include Groups in Commands, removing dp.groups.groups. | 699f767ac316edd481630a943f7a1884c5bc16f2 | Jan Allersma | 2018-11-07 11:27:15 |
Fix ability to nest in Groups. | fd546a42ef54bdf5d2966eb7facbbf21a6b72e1b | Jan Allersma | 2018-11-06 17:49:11 |
Fix file I/O for single entities. | 093b7d31a215067212927b1d92bdbbee306ea345 | Jan Allersma | 2018-11-06 16:49:55 |
Fix file I/O issue. | 25c0b40db223c806eb3ea8bd28238dedc38ca8b5 | Jan Allersma | 2018-11-02 16:22:59 |
Cleanup commenting. | 445aea4a5115c9110a097bfc7ac9f7d5ad48a9e7 | Jan Allersma | 2018-11-02 14:33:08 |
Show Ornaments on Canvas. | d8456f15d69550c4cb0aa615cccb96b45a77f6a6 | Jan Allersma | 2018-11-02 14:08:47 |
Support Entities for Create & Destruct commands. | cc900579eedf9c6288ce1c1883122856794e05a0 | Jan Allersma | 2018-11-02 13:25:43 |
Use entities instead of shapes when constructing ornaments. | 13f08847624489f60a37db55c2aedbba6b021f98 | Jan Allersma | 2018-11-01 17:02:47 |
Remove obsolete 'calcBounds' function. | 475ec330736b5800d12d091415480b163dd244e2 | Jan Allersma | 2018-11-01 14:28:29 |
Setup for decorator pattern. | 762914dec31b1fb1d4cf6bb0cef2e148010652a4 | Jan Allersma | 2018-11-01 14:12:51 |
Revert commit '5678eb6'. | 6225242719b2cfc5ee0de9f8d05edbc7a69007a7 | Jan Allersma | 2018-11-01 14:10:27 |
Make groups movable and resizable. | 1ca7c18ab103a8d1055b27f63192038fd75aef3e | Jan Allersma | 2018-10-17 14:51:32 |
Use translations instead of positions for moving shapes. | 9551c7d2608f01c3950743fd97bd217aab8f5766 | Jan Allersma | 2018-10-16 16:11:03 |
Implement Visitor pattern for Groups. | bd30477ce616362d3f58cef072d1ebc78077fa85 | Jan Allersma | 2018-10-16 13:28:37 |
Implement Visitor pattern for Shapes. | e52412c3059c1ee5fa9abdf4a32db0f47981eee1 | Jan Allersma | 2018-10-16 12:43:17 |
Setup 'Decorator' and 'Ornament' class. | 5678eb6257bcf88502078d08395a394a1c24568b | Jan Allersma | 2018-10-09 09:29:50 |
Use different strats instead of seperate Shapes. | a56e1e665a0292d15139eddfd8ebdeb8c95251b4 | Jan Allersma | 2018-10-01 11:37:45 |
Make ornament interface compatible with Entities. | 21383d5f200a338f8255d7d33b6989937c19fed6 | Jan Allersma | 2018-10-08 20:36:23 |
Fix bug in Rect from commit 6c91140 in other Shapes as well. | 4165a5da98dd9a548a222c6160390e4e54026d48 | Jan Allersma | 2018-09-28 14:53:40 |
Build interface for ornament creation. | adcf22a4e878edc45ac0775a5e15ebf0bb1a937d | Jan Allersma | 2018-10-08 13:53:52 |
File | Lines added | Lines deleted |
---|---|---|
source/entities/group.d | 4 | 4 |
source/entities/shape/entornament.d | 5 | 0 |
source/file.d | 4 | 1 |
source/frontend/menubar.d | 3 | 1 |
source/groups.d | 1 | 10 |
source/history.d | 0 | 8 |
File source/entities/group.d changed (mode: 100644) (index f7518ee..f0a3e18) | |||
... | ... | import Global = dp.global; | |
12 | 12 | class Group : Entity { | class Group : Entity { |
13 | 13 | public double[3] colour; // R, G, B | public double[3] colour; // R, G, B |
14 | 14 | private Entity[] entities; | private Entity[] entities; |
15 | private double s; | ||
15 | private double _size; | ||
16 | 16 | ||
17 | 17 | this() { | this() { |
18 | s = 1; | ||
18 | _size = 1; | ||
19 | 19 | entities = []; | entities = []; |
20 | 20 | active = true; | active = true; |
21 | 21 | colour = [ | colour = [ |
... | ... | class Group : Entity { | |
27 | 27 | ||
28 | 28 | @property | @property |
29 | 29 | public override double size() { | public override double size() { |
30 | return s; | ||
30 | return _size; | ||
31 | 31 | } | } |
32 | 32 | ||
33 | 33 | @property | @property |
34 | 34 | public override double size(double s) { | public override double size(double s) { |
35 | return this.s = s; | ||
35 | return this._size = s; | ||
36 | 36 | } | } |
37 | 37 | ||
38 | 38 | @property | @property |
File source/entities/shape/entornament.d changed (mode: 100644) (index caeddf1..e4f5e81) | |||
... | ... | import dp.dec.entity; | |
4 | 4 | import dp.ent.entity; | import dp.ent.entity; |
5 | 5 | import dp.ent.ornament; | import dp.ent.ornament; |
6 | 6 | ||
7 | import std.stdio; // Debug | ||
8 | |||
7 | 9 | class EntityOrnament : Decorator { | class EntityOrnament : Decorator { |
8 | 10 | Ornament o; | Ornament o; |
9 | 11 | ||
... | ... | class EntityOrnament : Decorator { | |
25 | 27 | @property | @property |
26 | 28 | public override string to_string() { | public override string to_string() { |
27 | 29 | string result = e.to_string; | string result = e.to_string; |
30 | writeln("PRE-RES: " ~ result); | ||
28 | 31 | ||
29 | 32 | if(o !is null) | if(o !is null) |
30 | 33 | result ~= "\n" ~ o.to_string; | result ~= "\n" ~ o.to_string; |
31 | 34 | ||
35 | writeln("POST_RES: " ~ result); | ||
36 | |||
32 | 37 | return result; | return result; |
33 | 38 | } | } |
34 | 39 |
File source/file.d changed (mode: 100644) (index 84876e4..e2c5d9a) | |||
... | ... | public class Savefile { | |
25 | 25 | } | } |
26 | 26 | ||
27 | 27 | public void toFile(Entity entity) { | public void toFile(Entity entity) { |
28 | if(entity.active) | ||
28 | write("E(" ~ entity.to_string() ~ "): "); | ||
29 | if(entity.active) { | ||
30 | writeln("Active"); | ||
29 | 31 | content ~= entity.to_string(); | content ~= entity.to_string(); |
32 | } else writeln("Inactive"); | ||
30 | 33 | } | } |
31 | 34 | ||
32 | 35 | public void load() { | public void load() { |
File source/frontend/menubar.d changed (mode: 100644) (index 20b66c2..b7b862b) | |||
... | ... | public class GroupMenu : MenuItem { // protected | |
206 | 206 | } | } |
207 | 207 | ||
208 | 208 | private bool newGroupCallback(Event event, Widget widget) { | private bool newGroupCallback(Event event, Widget widget) { |
209 | Global.Brush.group = Global.Groups.newGroup; | ||
209 | Group g = Global.Groups.newGroup; | ||
210 | Global.History.addCommand(new CreateCmd(g)); | ||
211 | Global.Brush.group = g; | ||
210 | 212 | Global.selection.update("Group " ~ to!string(Global.Groups.count - 1)); | Global.selection.update("Group " ~ to!string(Global.Groups.count - 1)); |
211 | 213 | return true; | return true; |
212 | 214 | } | } |
File source/groups.d changed (mode: 100644) (index f8f1488..c1a78de) | |||
... | ... | import dp.ent.group; | |
4 | 4 | import Brush = dp.brush; | import Brush = dp.brush; |
5 | 5 | ||
6 | 6 | public static class Groups { | public static class Groups { |
7 | private static Group[] groups = []; | ||
8 | 7 | private static size_t _count = 0; | private static size_t _count = 0; |
9 | 8 | ||
10 | 9 | @property | @property |
... | ... | public static class Groups { | |
12 | 11 | return _count; | return _count; |
13 | 12 | } | } |
14 | 13 | ||
15 | @property | ||
16 | public static Group[] get() { | ||
17 | return groups; | ||
18 | } | ||
19 | |||
20 | 14 | @property | @property |
21 | 15 | public static Group newGroup() { | public static Group newGroup() { |
22 | 16 | _count += 1; | _count += 1; |
23 | 17 | if(Brush.group is null) { | if(Brush.group is null) { |
24 | groups.length++; | ||
25 | groups[groups.length-1] = new Group(); | ||
26 | return groups[groups.length-1]; | ||
18 | return new Group(); | ||
27 | 19 | } else { | } else { |
28 | 20 | Group g = new Group(); | Group g = new Group(); |
29 | 21 | Brush.group.add(g); | Brush.group.add(g); |
... | ... | public static class Groups { | |
33 | 25 | } | } |
34 | 26 | ||
35 | 27 | public static void clear() { | public static void clear() { |
36 | groups = []; | ||
37 | 28 | _count = 0; | _count = 0; |
38 | 29 | Brush.group = null; | Brush.group = null; |
39 | 30 | } | } |
File source/history.d changed (mode: 100644) (index a69563a..704c2fb) | |||
... | ... | static class History { | |
50 | 50 | public static void render() { | public static void render() { |
51 | 51 | foreach(command; commands) | foreach(command; commands) |
52 | 52 | command.render(); | command.render(); |
53 | |||
54 | foreach(group; Global.Groups.get) | ||
55 | group.render(); | ||
56 | 53 | } | } |
57 | 54 | ||
58 | 55 | public static void CheckBounds(int x, int y) { | public static void CheckBounds(int x, int y) { |
... | ... | static class History { | |
70 | 67 | foreach(command; commands) | foreach(command; commands) |
71 | 68 | command.save(file); | command.save(file); |
72 | 69 | ||
73 | foreach(group; Global.Groups.get) { | ||
74 | if(group.group is null) | ||
75 | file.toFile(group); | ||
76 | } | ||
77 | |||
78 | 70 | file.save(); | file.save(); |
79 | 71 | } | } |
80 | 72 |