Skip to content

Commit

Permalink
Merge branch 'OSGeo:main' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
a0x8o authored Nov 22, 2023
2 parents 8f5e4bb + ef229b7 commit da38f23
Show file tree
Hide file tree
Showing 62 changed files with 484 additions and 436 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/python-code-quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,10 @@ jobs:
- name: Run Pylint on other files using pytest
run: |
pip install pytest pytest-pylint==0.19
echo "::warning file=.github/workflows/python-code-quality.yml,line=116,col=42,endColumn=48::Temporarily downgraded pytest-pylint to allow merging other PRs. The errors reported with a newer version seem legitimite and should be fixed (2023-10-18, see https://github.com/OSGeo/grass/pull/3205)"
echo "::warning file=.github/workflows/python-code-quality.yml,line=116,col=42,endColumn=48::\
Temporarily downgraded pytest-pylint to allow merging other PRs. The errors reported\
with a newer version seem legitimite and should be fixed (2023-10-18,\
see https://github.com/OSGeo/grass/pull/3205)"
export PYTHONPATH=`grass --config python_path`:$PYTHONPATH
export LD_LIBRARY_PATH=$HOME/install/grass84/lib:$LD_LIBRARY_PATH
pytest --pylint -m pylint --pylint-rcfile=.pylintrc --pylint-jobs=$(nproc) \
Expand Down
9 changes: 7 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
---
ci:
skip: [flake8]
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
Expand Down Expand Up @@ -60,11 +62,14 @@ repos:
types_or: [c, c++, javascript, json, objective-c]
exclude: |
(?x)^(
man/jquery.fixedheadertable.min.js
man/jquery.fixedheadertable.min.js$|
.*\.ipynb$
)
- repo: https://github.com/adrienverge/yamllint.git
rev: v1.29.0
hooks:
- id: yamllint
args: [--format, parsable, --strict, -d,
'{extends: default, rules: {truthy: disable, line-length: {max: 120, allow-non-breakable-words: true}}}']
'{extends: default, rules: {truthy: disable,
line-length: {max: 120, allow-non-breakable-words: true},
comments: {min-spaces-from-content: 1}}}']
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# syntax=docker/dockerfile:1.4
# syntax=docker/dockerfile:1.6

# Note: This file must be kept in sync in ./Dockerfile and ./docker/ubuntu/Dockerfile.
# Changes to this file must be copied over to the other file.
# Changes to this file must be copied over to the other file.

ARG GUI=without

Expand Down
2 changes: 1 addition & 1 deletion contributors.csv
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ cvs_id,name,email,country,osgeo_id,rfc2_agreed,orcid
-,Markus Metz,<markus.metz.giswork googlemail.com>,Germany,mmetz,yes,0000-0002-4038-8754
-,Maris Nartiss,<maris.gis gmail.com>,Latvia,marisn,yes,0000-0002-3875-740X
-,Marco Pasetti,<marco.pasetti alice.it>,Italy,marcopx,yes,-
-,Yann Chemin,<yann.chemin gmail.com>,Philippines,ychemin,yes,0000-0001-9232-5512
-,Yann Chemin,<dr.yann.chemin gmail.com>,France,ychemin,yes,0000-0001-9232-5512
-,Colin Nielsen,<colin.nielsen gmail.com>,USA,cnielsen,yes,-
-,Anne Ghisla,<a.ghisla gmail.com>,Italy,aghisla,yes,-
-,Helmut Kudrnovsky,<hellik web.de>,Austria,hellik,yes,0000-0001-6622-7169
Expand Down
1 change: 1 addition & 0 deletions display/d.legend.vect/draw.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ void draw(char *file_name, double LL, double LT, char *title, int cols,

/* Draw title */
title_h = 0;
title_w = 0;
if (strlen(title) > 0) {
D_font(tit_font);
D_text_size(tit_size, tit_size);
Expand Down
7 changes: 7 additions & 0 deletions display/d.vect/d.vect.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@ <h2>NOTES</h2>
which allow the user to specify vector type, colors, data fields, SQL
queries, label size and justification, etc.

<p>When <em>d.vect</em> is used with <b>where</b> parameter on MS Windows
Command Prompt, it is important to use <tt>&#710;</tt>
carret symbol for escaping special characters <tt>&lt; &gt; ( ) &amp; &#124; , ; &quot;</tt>.
<div class="code"><pre>
d.vect map=vector_map where="cat &#710;&gt; 10 AND cat &#710;&lt; 20"
</pre></div>

<p>By default <em>d.vect</em> areas are filled with <b>fill_color</b> and
outlined with <b>color</b>. Area outlines can be suppressed with
<div class="code"><pre>
Expand Down
32 changes: 21 additions & 11 deletions display/d.vect/label.c
Original file line number Diff line number Diff line change
Expand Up @@ -151,12 +151,26 @@ int process_line(int ltype, const struct line_pnts *Points,
void show_label(double *px, double *py, LATTR *lattr, const char *text)
{
double X = *px, Y = *py;
int Xoffset, Yoffset;
double Xoffset;
double xarr[5], yarr[5];
double T, B, L, R;
double ysize;

/* Vertical alignment has to be performed in advance as returned box
* height will depend on letters in use. Shifting of Y location
* ensures that text baseline is aligned instead of just bounding box.
* This logic will break down for any vertical texts.
* A proper fix would be to obtain baseline and shift it around. */
ysize = D_get_d_to_u_yconv() * lattr->size;
if (lattr->yref == LBOTTOM)
Y = Y - ysize * 0.6;
else if (lattr->yref == LCENTER)
Y = Y + ysize * 0.35;
else
Y = Y + ysize * 1.4;

X = X + D_get_d_to_u_xconv() * 0.5 * lattr->size;
Y = Y + D_get_d_to_u_yconv() * 1.5 * lattr->size;
if (lattr->xref != LRIGHT)
X = X + D_get_d_to_u_xconv() * 0.5 * lattr->size;

D_pos_abs(X, Y);
D_get_text_box(text, &T, &B, &L, &R);
Expand All @@ -168,21 +182,17 @@ void show_label(double *px, double *py, LATTR *lattr, const char *text)
R = R + D_get_d_to_u_xconv() * lattr->size / 2;

Xoffset = 0;
Yoffset = 0;

if (lattr->xref == LCENTER)
Xoffset = -(R - L) / 2;
if (lattr->xref == LRIGHT)
Xoffset = -(R - L);
if (lattr->yref == LCENTER)
Yoffset = -(B - T) / 2;
if (lattr->yref == LBOTTOM)
Yoffset = -(B - T);

if (lattr->has_bgcolor || lattr->has_bcolor) {
xarr[0] = xarr[1] = xarr[4] = L + Xoffset;
xarr[2] = xarr[3] = R + Xoffset;
yarr[0] = yarr[3] = yarr[4] = B + Yoffset;
yarr[1] = yarr[2] = T + Yoffset;
yarr[0] = yarr[3] = yarr[4] = B;
yarr[1] = yarr[2] = T;

if (lattr->has_bgcolor) {
D_RGB_color(lattr->bgcolor.R, lattr->bgcolor.G, lattr->bgcolor.B);
Expand All @@ -196,7 +206,7 @@ void show_label(double *px, double *py, LATTR *lattr, const char *text)
D_RGB_color(lattr->color.R, lattr->color.G, lattr->color.B);
}

D_pos_abs(X + Xoffset, Y + Yoffset);
D_pos_abs(X + Xoffset, Y);
D_text(text);
}

Expand Down
4 changes: 2 additions & 2 deletions docker/ubuntu/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# syntax=docker/dockerfile:1.4
# syntax=docker/dockerfile:1.6

# Note: This file must be kept in sync in ./Dockerfile and ./docker/ubuntu/Dockerfile.
# Changes to this file must be copied over to the other file.
# Changes to this file must be copied over to the other file.

ARG GUI=without

Expand Down
Loading

0 comments on commit da38f23

Please sign in to comment.