Skip to content

Commit f43b372

Browse files
committed
Added sum-unit pencil widths
1 parent 34696c0 commit f43b372

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

beePen_QWidget.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ def create_annotation_layer(self):
146146
shape_name = file_path.split("/")[-1].split(".")[0]
147147
geom_type = ogr.wkbLineString
148148

149-
fields_dict_list = [{"name": "width", "ogr_type": ogr.OFTInteger},
149+
fields_dict_list = [{"name": "width", "ogr_type": ogr.OFTReal},
150150
{"name": "transp", "ogr_type": ogr.OFTInteger},
151151
{"name": "color", "ogr_type": ogr.OFTString, "width": 20}]
152152

@@ -170,7 +170,7 @@ def get_current_color_name_choice(self):
170170

171171
def get_current_pencil_width_choice(self):
172172

173-
self.pencil_width = int(self.pen_width_QComboBox.currentText())
173+
self.pencil_width = float(self.pen_width_QComboBox.currentText())
174174
# self.info("Width is %d" % (self.pencil_width))
175175
self.style_signal.emit("width", str(self.pencil_width))
176176

beePen_gui.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def __init__(self, interface):
5454
self.pencil_active = False
5555
self.plugin_name = "beePen"
5656

57-
self.pen_widths = [1,5,10,25,50,100,250,500,750,1000]
57+
self.pen_widths = [0.01, 0.02, 0.05, 0.08, 0.1, 0.2, 0.5, 1,5,10,25,50,100,250,500,750,1000]
5858
self.pen_transparencies = [0,25,50,75]
5959
self.pen_colors = ["blue","red","yellow","green","orange","violet","pink"]
6060

freehandeditingtool.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def update_pen_style(self, name, parameter):
6565
if name == "color":
6666
self.color_name = parameter
6767
elif name == "width":
68-
self.pencil_width = int(parameter)
68+
self.pencil_width = float(parameter)
6969
elif name == "transparency":
7070
self.transparency = int(parameter)
7171

metadata.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name=beePen
33
description=Allows to draw freehand lines in a layer
44
category=Vector
5-
version=0.0.8
5+
version=0.0.9
66
experimental=False
77
qgisMinimumVersion=2.0
88
author=Mauro Alberti, Mauro DeDonatis
@@ -18,7 +18,8 @@ changelog=
1818
0.0.6 : - pencil widths in map units, so they scale correctly with map extent
1919
0.0.7 : - removed unwanted styling on non-annotation layers
2020
0.0.8 : - removed bug appearing when multiple clicks on pencil tool; added eraser tool
21-
21+
0.0.8 : - added sub-unit pencil widths
22+
2223
; tags are in comma separated value format, spaces are allowed
2324
tags = annotation, field work, geology, mapping
2425

0 commit comments

Comments
 (0)