Skip to content
This repository was archived by the owner on Feb 28, 2023. It is now read-only.

Commit 26349ec

Browse files
committed
Merge branch 'release/0432'
2 parents 3f16815 + 1621286 commit 26349ec

File tree

19 files changed

+221
-211
lines changed

19 files changed

+221
-211
lines changed

CHANGELOG.md

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
1+
# Version 0xxx - 2015/xx/xx
2+
3+
### Additions
4+
- Added scaling for folder and name labels based on the camera's zoom factor
5+
- Added MessageBox which displays a warning in case git isn't found on the user's system (Closes [#50](https://github.com/rm-code/logivi/issues/50))
6+
- Added mouse panning and scaling (Closes [#45](https://github.com/rm-code/logivi/issues/45))
7+
- The mouse can be used to drag around the camera while the left button is pressed
8+
- The mouse wheel can be used to zoom in and out
9+
10+
### Fixes
11+
- Fixed [#51](https://github.com/rm-code/logivi/issues/51) - Fixed crash caused by faulty variable
12+
- Fixed [#48](https://github.com/rm-code/logivi/issues/48) - Got rid of the timer for color fading
13+
- Fixed [#35](https://github.com/rm-code/logivi/issues/35) - Made large graphs more stable
14+
- Fixed minor issue with folder labels being drawn multiple times per frame
15+
16+
### Other Changes
17+
- LoGiVi now starts in windowed mode on first start
18+
- Canged design of the file panel to be less intrusive
19+
120
# Version 0404 - 2015/11/24
221

322
### Additions
@@ -67,7 +86,7 @@
6786
- Added config file validation after it has been loaded (Closes [#26](https://github.com/rm-code/logivi/issues/26))
6887

6988
### Fixes
70-
- Fixed [#33](https://github.com/rm-code/logivi/issues/33) - Ignore lines in config file which aren't formatted correctly
89+
- Fixed [#33](https://github.com/rm-code/logivi/issues/33) - Ignore lines in config file which aren't formatted correctly
7190
- Fixed [#32](https://github.com/rm-code/logivi/issues/32) - Resize Timeline when MainScreen is resized
7291
- Fixed [#31](https://github.com/rm-code/logivi/issues/31) - Directly pass the repository's path to the git command
7392
- Fixed [#30](https://github.com/rm-code/logivi/issues/30) - Ignore files when no changes were applied
@@ -95,7 +114,7 @@
95114
- Added keybinding for manually loading the previous commit
96115
- Added keybinding for rewersing the graph creation (will run back until it reaches the first commit)
97116
- Added keybinding for toggling fullscreen mode
98-
- Added a timeline
117+
- Added a timeline
99118
- Indicates the current position of the log compared to the total commit history and shows the date of the currently indexed commit
100119
- Allows the user to quickly jump around in time (forward and backwards) while still rendering the full graph (Closes [#10](https://github.com/rm-code/logivi/issues/10))
101120
- Can be hidden via keybinding or in the config file
@@ -172,7 +191,7 @@
172191
- Rewrote most of the graph system
173192
- The graph is structured and handled completely different than before with files, folder nodes and edges being independent from each other
174193
- Gets rid of a lot of issues like edges overlaying other nodes
175-
- The arrangement of files around folder nodes is no longer updated every frame
194+
- The arrangement of files around folder nodes is no longer updated every frame
176195
- Major improvements in memory usage, performance and garbage production
177196
- Updated log reader to separate commits based on the author tag instead of looking for the "special" logivi_commit tag (which was pretty useless anyway)
178197
- Updated log reader to digest unix timestamps and transform them into human readable dates
@@ -192,7 +211,7 @@
192211

193212
### Additions
194213
- Added (rudimentary) Force-Directed Graph which - visualises the files and folders of a git repository at a given point in time
195-
- Files are represented as evenly distributed leaves around their parent folder node
214+
- Files are represented as evenly distributed leaves around their parent folder node
196215
- Depending on the amount of files in one folder new folders will be created automatically)
197216
- Modified files are coloured red and fade back to their original color over time
198217
- Folders are represented as single green dots (this will be changed in one of the next releases) and are connected by lines
@@ -204,4 +223,4 @@
204223
- Authors will show links to the files they currently edit
205224
- Authors can be assigned an alias
206225
- Authors can be assigned an avatar (grabbed online)
207-
- Added warning message if no log file can be found
226+
- Added warning message if no log file can be found

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# LoGiVi
22

3-
LoGiVi is a git-repository visualisation tool inspired by [Gource](http://gource.io/) and __currently in development__. It was written from scratch using [Lua](http://www.lua.org/) and the [LÖVE](https://love2d.org/) framework. Note: Since version [0375](https://github.com/rm-code/logivi/releases/tag/0375) LoGiVi uses version [0.10.0](https://love2d.org/wiki/0.10.0) of the LÖVE framework.
3+
LoGiVi is a git-repository visualisation tool inspired by [Gource](http://gource.io/) and __currently in development__. It was written from scratch using [Lua](http://www.lua.org/) and the [LÖVE](https://love2d.org/) framework.
4+
5+
Note: Since version [0375](https://github.com/rm-code/logivi/releases/tag/0375) LoGiVi uses version [0.10.0](https://love2d.org/wiki/0.10.0) of the LÖVE framework.
46

57
![Example Visualization](https://github.com/rm-code/logivi/wiki/media/logivi_0312.gif)
68

@@ -46,9 +48,6 @@ This will create the file _log.txt_ in the folder you are currently in. Take thi
4648
/Users/Robert/Library/Application Support/LOVE/rmcode_LoGiVi/logs/yourProject/log.txt
4749
```
4850
LoGiVi will use the folder's name to identify the log so make it informative.
49-
50-
# LÖVE Version
51-
Version 0351 and all prior versions of LoGiVi are written for Version 0.9.2 of the LÖVE framework. ___All future versions will be based on LÖVE 0.10.0 (currently unreleased).___
5251

5352
# License
5453

conf.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
local PROJECT_TITLE = "LoGiVi";
22

3-
local PROJECT_VERSION = "0404";
3+
local PROJECT_VERSION = "0432";
44

55
local PROJECT_IDENTITY = "rmcode_LoGiVi";
66

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ backgroundColor = 0, 0, 0
1818
removeTmpFiles = false
1919
screenWidth = 0
2020
screenHeight = 0
21-
fullscreen = true
21+
fullscreen = false
2222
fullscreenType = desktop
2323
vsync = true
2424
msaa = 0

src/Author.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ function Author.new(name, avatar, cx, cy)
8282
-- Public Functions
8383
-- ------------------------------------------------
8484

85-
function self:draw(rotation)
85+
function self:draw(rotation, scale)
8686
if active then
8787
love.graphics.setLineWidth(BEAM_WIDTH);
8888
for i = 1, #links do
@@ -94,7 +94,7 @@ function Author.new(name, avatar, cx, cy)
9494
love.graphics.setColor(255, 255, 255, avatarAlpha);
9595
love.graphics.draw(avatar, posX, posY, -rotation, AVATAR_SIZE / aw, AVATAR_SIZE / ah, aw * 0.5, ah * 0.5);
9696
love.graphics.setFont(LABEL_FONT);
97-
love.graphics.print(name, posX, posY, -rotation, 1, 1, LABEL_FONT:getWidth(name) * 0.5, - AVATAR_SIZE);
97+
love.graphics.print(name, posX, posY, -rotation, 1 / scale, 1 / scale, LABEL_FONT:getWidth(name) * 0.5, - AVATAR_SIZE * scale);
9898
love.graphics.setFont(DEFAULT_FONT);
9999
love.graphics.setColor(255, 255, 255, 255);
100100
end

src/AuthorManager.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,10 @@ end
9595
---
9696
-- Draws a list of all authors working on the project.
9797
--
98-
function AuthorManager.drawLabels(rotation)
98+
function AuthorManager.drawLabels(rotation, scale)
9999
if visible then
100100
for _, author in pairs(authors) do
101-
author:draw(rotation);
101+
author:draw(rotation, scale);
102102
end
103103
end
104104
end

src/FileManager.lua

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,6 @@ local colors;
2020
-- Local Functions
2121
-- ------------------------------------------------
2222

23-
---
24-
-- Returns the extension of a file (or '.?' if it doesn't have one).
25-
-- @param fileName
26-
--
27-
local function splitExtension(fileName)
28-
return fileName:match("(%.[^.]+)$") or '.?';
29-
end
30-
3123
---
3224
-- Takes the extensions list and creates a list
3325
-- which is sorted by the amount of files per extension.
@@ -73,9 +65,9 @@ end
7365
---
7466
-- Adds a new file extension to the list.
7567
-- @param fileName
68+
-- @param ext
7669
--
77-
function FileManager.add(fileName)
78-
local ext = splitExtension(fileName);
70+
function FileManager.add(fileName, ext)
7971
if not extensions[ext] then
8072
extensions[ext] = {};
8173
extensions[ext].extension = ext;
@@ -99,9 +91,10 @@ end
9991
-- same extension. If there are no more files
10092
-- of that extension, it will remove it from
10193
-- the list.
94+
-- @param fileName
95+
-- @param ext
10296
--
103-
function FileManager.remove(fileName)
104-
local ext = splitExtension(fileName);
97+
function FileManager.remove(fileName, ext)
10598
if not extensions[ext] then
10699
error('Tried to remove the non existing file extension "' .. ext .. '".');
107100
end

src/conf/ConfigReader.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ local ConfigReader = {};
55
-- ------------------------------------------------
66

77
local FILE_NAME = 'settings.cfg';
8-
local TEMPLATE_PATH = 'res/templates/settings.cfg';
8+
local TEMPLATE_PATH = 'res/templates/settings_template.cfg';
99

1010
local INVALID_CONFIG_HEADER = 'Invalid config file';
1111
local MISSING_SECTION_WARNING = 'Seems like the loaded configuration file is missing the [%s] section. The default settings will be used instead.';

src/graph/File.lua

Lines changed: 36 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -4,51 +4,42 @@ local File = {};
44
-- Constants
55
-- ------------------------------------------------
66

7-
local MOD_TIMER = 2;
7+
local ANIM_TIMER = 3.5;
8+
local FADE_TIMER = 3.0;
9+
local MOD_TIMER = 1.5;
10+
811
local MOD_COLOR = {
9-
add = { r = 0, g = 255, b = 0 },
10-
del = { r = 255, g = 0, b = 0 },
11-
mod = { r = 254, g = 140, b = 0 },
12+
add = { r = 0, g = 255, b = 0, a = 255 },
13+
del = { r = 255, g = 0, b = 0, a = 255 },
14+
mod = { r = 254, g = 140, b = 0, a = 255 },
1215
};
1316

1417
-- ------------------------------------------------
1518
-- Constructor
1619
-- ------------------------------------------------
1720

18-
function File.new(parent, name, color, extension, x, y)
21+
function File.new(posX, posY, defaultColor, extension)
1922
local self = {};
2023

21-
local posX, posY = x, y;
24+
local state;
25+
26+
-- The target and the current offset from the parent node's position.
27+
-- This is used to arrange the files around a node.
2228
local targetOffsetX, targetOffsetY = 0, 0;
2329
local currentOffsetX, currentOffsetY = 0, 0;
24-
local fileColor, extension = color, extension;
25-
local currentColor = { r = 0, g = 0, b = 0, a = 255 };
26-
local modified = false;
27-
local timer = MOD_TIMER;
28-
local fade = false;
29-
local dead = false;
30+
31+
-- The actual color currently displayed on screen.
32+
local currentColor = {};
3033

3134
-- ------------------------------------------------
3235
-- Private Functions
3336
-- ------------------------------------------------
3437

35-
local function lerp(a, b, t)
36-
return a + (b - a) * t;
37-
end
38-
3938
---
40-
-- Resets the color values and the timer, and sets
41-
-- the modified flag to false.
39+
-- Linear interpolation between a and b.
4240
--
43-
local function reset()
44-
timer = MOD_TIMER;
45-
modified = false;
46-
fade = false;
47-
dead = false;
48-
currentColor.r = fileColor.r;
49-
currentColor.g = fileColor.g;
50-
currentColor.b = fileColor.b;
51-
currentColor.a = 255;
41+
local function lerp(a, b, t)
42+
return a + (b - a) * t;
5243
end
5344

5445
---
@@ -60,8 +51,8 @@ function File.new(parent, name, color, extension, x, y)
6051
-- @param tarY - The target offset on the y-axis.
6152
--
6253
local function animate(dt, tarX, tarY)
63-
currentOffsetX = lerp(currentOffsetX, tarX, dt * 3.5);
64-
currentOffsetY = lerp(currentOffsetY, tarY, dt * 3.5);
54+
currentOffsetX = lerp(currentOffsetX, tarX, dt * ANIM_TIMER);
55+
currentOffsetY = lerp(currentOffsetY, tarY, dt * ANIM_TIMER);
6556
end
6657

6758
-- ------------------------------------------------
@@ -76,42 +67,32 @@ function File.new(parent, name, color, extension, x, y)
7667
function self:update(dt)
7768
animate(dt, targetOffsetX, targetOffsetY);
7869

79-
if fade then
80-
currentColor.a = math.min(255, math.max(currentColor.a - 3, 0));
81-
if currentColor.a <= 0 then
82-
dead = true;
83-
end
84-
return;
85-
end
70+
-- Slowly change the color from the modified color back to the default.
71+
currentColor.r = lerp(currentColor.r, defaultColor.r, dt * MOD_TIMER);
72+
currentColor.g = lerp(currentColor.g, defaultColor.g, dt * MOD_TIMER);
73+
currentColor.b = lerp(currentColor.b, defaultColor.b, dt * MOD_TIMER);
8674

87-
if modified then
88-
if timer > 0 then
89-
timer = timer - dt;
90-
currentColor.r = lerp(currentColor.r, fileColor.r, dt * 1.5);
91-
currentColor.g = lerp(currentColor.g, fileColor.g, dt * 1.5);
92-
currentColor.b = lerp(currentColor.b, fileColor.b, dt * 1.5);
93-
else
94-
reset();
75+
-- Slowly fade out the file when it has been marked for deletion.
76+
if state == 'del' then
77+
currentColor.a = math.max(0, math.min(currentColor.a - FADE_TIMER, 255));
78+
if currentColor.a == 0 then
79+
state = 'dead';
9580
end
9681
end
9782
end
9883

9984
---
100-
-- Marks the file as modified and changes the
101-
-- current color to the modified color.
102-
-- @param mod
85+
-- Sets the state of the file and changes the current color to a specific
86+
-- color based on the used modifier.
87+
-- @param mod - The modifier used on the file.
10388
--
104-
function self:modify(mod)
105-
reset();
89+
function self:setState(mod)
90+
state = mod;
10691

107-
modified = true;
10892
currentColor.r = MOD_COLOR[mod].r;
10993
currentColor.g = MOD_COLOR[mod].g;
11094
currentColor.b = MOD_COLOR[mod].b;
111-
112-
if mod == 'del' then
113-
fade = true;
114-
end
95+
currentColor.a = MOD_COLOR[mod].a;
11596
end
11697

11798
-- ------------------------------------------------
@@ -153,7 +134,7 @@ function File.new(parent, name, color, extension, x, y)
153134
-- Returns true if the file is marked as dead.
154135
--
155136
function self:isDead()
156-
return dead;
137+
return state == 'dead';
157138
end
158139

159140
-- ------------------------------------------------

src/graph/Graph.lua

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -153,17 +153,17 @@ function Graph.new(ewidth, showLabels)
153153
-- @param path
154154
-- @param filename
155155
--
156-
local function applyGitModifier(modifier, path, filename, mode)
156+
local function applyGitModifier(modifier, path, filename, extension, mode)
157157
local targetNode = getNode(path);
158158

159159
local modifiedFile;
160160
if modifier == MOD_ADD then
161-
modifiedFile = targetNode:addFile(filename);
161+
modifiedFile = targetNode:addFile(filename, extension);
162162
elseif modifier == MOD_DELETE then
163163
if mode == 'normal' then
164164
modifiedFile = targetNode:markFileForDeletion(filename);
165165
else
166-
modifiedFile = targetNode:removeFile(filename);
166+
modifiedFile = targetNode:removeFile(filename, extension);
167167
end
168168
elseif modifier == MOD_MODIFY then
169169
modifiedFile = targetNode:modifyFile(filename);
@@ -179,12 +179,12 @@ function Graph.new(ewidth, showLabels)
179179
-- Public Functions
180180
-- ------------------------------------------------
181181

182-
function self:draw(camrot)
182+
function self:draw(camrot, camscale)
183183
root:draw(ewidth);
184184
love.graphics.draw(spritebatch);
185185

186186
if showLabels then
187-
root:drawLabel(camrot);
187+
root:drawLabel(camrot, camscale);
188188
end
189189
end
190190

0 commit comments

Comments
 (0)